sending mail through asp.net

nikhiljain27

Member
Joined
Nov 11, 2005
Messages
14
Programming Experience
1-3
I Imports System.Web.Mail

Try
Dim tempmail As New MailMessage
tempmail.To = "nikhil@marchinfotech.com"
tempmail.From = "saurabh@marchinfotech.com"
tempmail.Subject = "Hai"
tempmail.BodyFormat = MailFormat.Text
'tempmail.Body=me
SmtpMail.SmtpServer = "192.168.11.64"
SmtpMail.Send(tempmail)
' SmtpMail.Send("saurabh@marchinfotech.com", "nikhil@marchinfotech.com", "Welcome", "Hai nikhil")
Catch e1 As Exception
Response.Write(e1.Message)
End Try

My smtp service is running.

While i run this application, i got the in queue directory in "wwwroot" mailroot , but no mail is send or received.


Plz. solve the problem.
 
VB.NET:
[COLOR=#0000ff]Dim[/COLOR][SIZE=2] tempmail [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MailMessage
tempmail.To = "nikhil@marchinfotech.com"
tempmail.From = "saurabh@marchinfotech.com"
tempmail.Subject = "Hai"
tempmail.BodyFormat = MailFormat.Text
[/SIZE][SIZE=2][COLOR=red]tempmail.Body="Hello World"[/COLOR][/SIZE]
[SIZE=2]SmtpMail.SmtpServer = "localhost" [COLOR=darkgreen]'pay attention to add localhost or real SmptServer address otherwise it will not work[/COLOR]
SmtpMail.Send(tempmail)
[/SIZE]
 
Back
Top