Problem when sending email in Visual Studio 2005 Professional Edition. Please help!

  • Thread starter Thread starter bienwell
  • Start date Start date
B

bienwell

Hi all,

I've tried this code in Visual Studio 2005 Professional Edition to send
email. It didn't cause any errors, but didn't make any actions. The
Imports System.Net.mail is the object in this program. FromEmail and
Servername are variables in this code.


Dim mm As New MailMessage()
mm.From = New MailAddress(FromEmail)

mm.To.Add(Email_Address)

mm.Subject = subject

mm.Body = Msg



Dim smtp As New SmtpClient(ServerName)

smtp.Send(mm)



Anything wrong in this code ? Please advise. Thank you very much.
 
Hi,

This code worked fine. My problem was .NET framework 1.1 and 2.0 were
installed in the same server and it took version 1.1 as default. It has
nothing to do with authentication.

Thanks a lot.
 
Back
Top