Click here to Skip to main content
15,909,591 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Revolutions-pack-like explorer? Pin
Dave Kreskowiak6-Sep-16 2:33
mveDave Kreskowiak6-Sep-16 2:33 
GeneralRe: Revolutions-pack-like explorer? Pin
DutchComputerKid4-Sep-16 23:32
DutchComputerKid4-Sep-16 23:32 
QuestionDataTable Select Expressions Pin
jkirkerx31-Aug-16 10:51
professionaljkirkerx31-Aug-16 10:51 
AnswerRe: DataTable Select Expressions [solved] Pin
jkirkerx1-Sep-16 8:18
professionaljkirkerx1-Sep-16 8:18 
GeneralRe: DataTable Select Expressions [solved] Pin
Richard Deeming1-Sep-16 9:37
mveRichard Deeming1-Sep-16 9:37 
GeneralRe: DataTable Select Expressions [solved] Pin
jkirkerx1-Sep-16 9:48
professionaljkirkerx1-Sep-16 9:48 
GeneralRe: DataTable Select Expressions [solved] Pin
jkirkerx1-Sep-16 9:52
professionaljkirkerx1-Sep-16 9:52 
QuestionSorting a DataSet Pin
jkirkerx30-Aug-16 12:00
professionaljkirkerx30-Aug-16 12:00 
AnswerRe: Sorting a DataSet [solved] Pin
jkirkerx30-Aug-16 12:27
professionaljkirkerx30-Aug-16 12:27 
QuestionPointer translation Pin
SepPax30-Aug-16 2:50
SepPax30-Aug-16 2:50 
AnswerRe: Pointer translation Pin
Michael_Davies30-Aug-16 3:23
Michael_Davies30-Aug-16 3:23 
AnswerRe: Pointer translation Pin
Richard MacCutchan30-Aug-16 4:34
mveRichard MacCutchan30-Aug-16 4:34 
Questionvisual basic Pin
Member 1270513126-Aug-16 5:33
Member 1270513126-Aug-16 5:33 
AnswerRe: visual basic Pin
Richard Deeming26-Aug-16 5:43
mveRichard Deeming26-Aug-16 5:43 
QuestionRe: visual basic Pin
ZurdoDev26-Aug-16 8:28
professionalZurdoDev26-Aug-16 8:28 
Questionneural network simulator in visual basic Pin
Member 1270337325-Aug-16 5:37
Member 1270337325-Aug-16 5:37 
AnswerRe: neural network simulator in visual basic Pin
Richard MacCutchan25-Aug-16 20:39
mveRichard MacCutchan25-Aug-16 20:39 
AnswerRe: neural network simulator in visual basic Pin
Dave Kreskowiak26-Aug-16 2:42
mveDave Kreskowiak26-Aug-16 2:42 
QuestionResizing and Positioning A Selected Image Pin
99Freddo23-Aug-16 23:01
99Freddo23-Aug-16 23:01 
AnswerRe: Resizing and Positioning A Selected Image Pin
Richard Deeming24-Aug-16 2:04
mveRichard Deeming24-Aug-16 2:04 
GeneralRe: Resizing and Positioning A Selected Image Pin
99Freddo24-Aug-16 11:51
99Freddo24-Aug-16 11:51 
QuestionSending Email using company exchange server Pin
Taherhamdy17-Aug-16 22:10
Taherhamdy17-Aug-16 22:10 
AnswerRe: Sending Email using company exchange server Pin
Bernhard Hiller18-Aug-16 22:00
Bernhard Hiller18-Aug-16 22:00 
GeneralRe: Sending Email using company exchange server Pin
Taherhamdy19-Aug-16 21:50
Taherhamdy19-Aug-16 21:50 
Thanks Bernhard,

the code as below

Imports System.Net.Mail
Imports System.Net

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Text = "Taher Shaker Mailer"

End Sub

Private Sub BtnSend_Click(sender As Object, e As EventArgs) Handles BtnSend.Click


Dim MyMessage As New MailMessage()
MyMessage.From = New MailAddress("myemail@company.com")
MyMessage.To.Add("another@gmail.com")
MyMessage.Subject = "my subject"
MyMessage.Body = "my message body"

Dim MyNetworkCredential As New NetworkCredential
MyNetworkCredential.Domain = "companyserver.com"
MyNetworkCredential.UserName = "myusername"
MyNetworkCredential.Password = "mypassword"


Try

Dim MySmtpClient As New SmtpClient()
MySmtpClient.Host = "https://companyserver.com"
MySmtpClient.Credentials = MyNetworkCredential

MySmtpClient.Send(MyMessage)
Catch ex As SmtpException
MessageBox.Show(ex.ToString)
Exit Sub
End Try

End Sub


also the error as below:
System.net.mail.smtpException: Failure sending mail
GeneralRe: Sending Email using company exchange server Pin
Richard MacCutchan19-Aug-16 22:04
mveRichard MacCutchan19-Aug-16 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.