Imports System.Net.Mail
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim mm As New System.Net.Mail.MailMessage("my email address", "recipients email address")
mm.IsBodyHtml = True
mm.Body = "
Hello World
" mm.Subject = "Test"
Dim client As New System.Net.Mail.SmtpClient("Service provider smtp address")
client.Credentials = New System.Net.NetworkCredential("my user name", "my password")
client.Send(mm)
Dispose()
End Sub
Any help or suggestions would be greatly appreciated.
Many thanks
Steve
Stephen FordPosted Aug 31, 2012, 6:04 AM
In solution explorer proerties I have set use dynamic ports to false and port number to 56120.
Code line now reads:
client As New System.Net.Mail.SmtpClient("blueyonder.co.uk", 56120)
No errors are generated but I am still unable to send email.
Thanks again for your help
Sukesh MarlaPosted Aug 30, 2012, 11:07 AM
here second parameter
if still dont work try to upload your code.
Stephen FordPosted Aug 30, 2012, 5:37 AM
Thanks for your reply.
To and From Addresses are contained in the line:
Dim mm as New System.Net.Mail.Mailmessage("my email address", "recipients email address")
where "my email address" is the from address and "recipients email address" is the to address.
How and where do I specify a Port Number ?
Sukesh MarlaPosted Aug 30, 2012, 5:19 AM