vb.net - Sending Mail Failure: SMTP Exception -
I hope that you will help me today I would like to develop a mail application using vb.net For this, I have written the code below.
This code throws an exception ("SMTP exception")
String = "Report Claims as Public Function SendAnEmail (ByVal MsgBody as String) "Dim MsgFrom string =" amolkadam.a@gmail.com "Dim MsgTo string =" amolkadam.a@gmail.com "Try as dimmsgsubject as' a new MailMessage slow message New Net.Mail.MailMessage (MsgFrom, MsgTo, MsgSubject, MsgBody) to send messages in the message 'Create a SmtpClient New SmtpClient Send Email as Dynamic MailClient ("219.64.91.90") '= Local Machine IP Address' Use Windows Credentials of the current user mailClient.UseDefaultCredentials =' Optional User Assurance near the mail message mail server mailClient.Send (MSG): String.Format MessageBox.Show (("Message subject successfully sent from {1} to {2}", MsgSubject, MsgFrom, MsgTo), "Email", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Information ) 'Housekeeping msg.Dispose () pre-formatException MessageBox.Show (ex.Message & amp; "Exception: format exception") pre-smtpException MessageBox.Show (ex.Message & amp; ",: SMTP exception") Try End End Function
< Div class = "post -text" itemprop = "text">
You have written the code to use your own PC as a mail server, is that correct? Just do not misunderstood you that the IP sent to the SMtpClient
should be the IP of the server.
If you have an SMTP server running on your local PC, then you tried to send emails from that server to another client? And that the server will accept a gmail.com address with a from
email (not some servers).