M
mtczx232
I find below code or like in some sites (http://www.orcsweb.com/
articles/sending_smtp_authenticated_email.aspx)
my ISP announce that soon we need to give Authentication for sending
EMAIL. I add this code to my App, and I see that Even the Username &
Pass is not correct, the email send with no error. I try it with same
name & pass on OutlookExpress and I got Error. so it's seem to me that
this code not use with Credential that I give?
==================Heare the code
'Create a new MailMessage object and specify the "From" and "To"
addresses
Dim Email As New
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)")
Email.Subject = "test subject"
Email.Body = "this is a test"
Dim mailClient As New System.Net.Mail.SmtpClient()
'This object stores the authentication values
Dim basicAuthenticationInfo As New
System.Net.NetworkCredential("username", "password")
'Put your own, or your ISPs, mail server name on this next line
mailClient.Host = "Mail.RemoteMailServer.com"
mailClient.UseDefaultCredentials = False
mailClient.Credentials = basicAuthenticationInfo
mailClient.Send(Email)
articles/sending_smtp_authenticated_email.aspx)
my ISP announce that soon we need to give Authentication for sending
EMAIL. I add this code to my App, and I see that Even the Username &
Pass is not correct, the email send with no error. I try it with same
name & pass on OutlookExpress and I got Error. so it's seem to me that
this code not use with Credential that I give?
==================Heare the code
'Create a new MailMessage object and specify the "From" and "To"
addresses
Dim Email As New
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)")
Email.Subject = "test subject"
Email.Body = "this is a test"
Dim mailClient As New System.Net.Mail.SmtpClient()
'This object stores the authentication values
Dim basicAuthenticationInfo As New
System.Net.NetworkCredential("username", "password")
'Put your own, or your ISPs, mail server name on this next line
mailClient.Host = "Mail.RemoteMailServer.com"
mailClient.UseDefaultCredentials = False
mailClient.Credentials = basicAuthenticationInfo
mailClient.Send(Email)