I am using this code in vb.net 2005 to sent an email but an error FAILURE SENDING MAIL is allways appearing. Can someone show me where I am duing wrong.
Try
Dim SmtpClient As New System.Net.Mail.SmtpClient
SmtpClient.Host = "localhost"
SmtpClient.Port = 25
SmtpClient.UseDefaultCredentials = True
SmtpClient.Send("glennzarb@gmail.com", "glenn_zarb@hotmail.com", "Test", "hi")
MsgBox("sent")
Catch ex As Exception
MsgBox("Send failure:" & ex.Message)
End Try
I haven't installed any other programs or smpt's

EMAIL
The Emerald Knight
Wendell G
it all depends if the email provider allows you to send emails through them programmatically, and if so, they will give you/have instructions about using their SMTP server.
For example, my web hosting provider allows emails to be sent through them through an SMTP server, they gave me all the details required to send emails through them programmatically - the same thing would apply for any email service provider - only if they allow/support users sending emails through their servers programmatically rather than through their web/client based email system
we7313
the code is pretty much the same as you have done, except replacing the email address and SMTP server address details etc...
I use mine to send emails from my ASP.NET website using the System.Web.Mail class (MailMessage/SMTP classes) however it uses pretty much the same procedure/methods to send out an email.
Simply put - the code you have posted is correct. All you need now is an SMTP service which allows you to send emails using the SMTP server details.
Suhask
Buddhist
naguaramipana
VBGMan
RickGaribay.NET
Jimmy_fingers
Mojosound
Jweige
Again, it does not matter about the email service that a person is using but rather if the email service provider supports/allows its customers/users to send emails programmatically via their SMTP servers.
However in regards to the question, I use my own website email services, provided by my web hosting provider to send out any emails I wish to programmatically.
Keith Newton
you cannot use hotmail to send emails via this method. you need to either:
1) setup your own SMTP service using IIS and configuring it
2) use some other email service which allows you to use their SMTP server to send email through
Docpro777
O11y