Dim MMsg As MailMessage = New MailMessage
MMsg.BodyEncoding = Encoding.Default
MMsg.From = "asdf@hotmail.com"
MMsg.To = "test@gmail.com"
MMsg.Subject = "Email with Subject Demo"
MMsg.Body = "This is the main body of the email"
MMsg.Priority = MailPriority.High
MMsg.BodyFormat = MailFormat.Html
System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1"
System.Web.Mail.SmtpMail.Send(MMsg)
lblmsg.Text = "Message sent successfully!"
This code successfully run no exception occurs but mails are not being recived on the TO Address and mails are still in the folder ie,"C:\Inetpub\mailroot\Queue". how to solve it
Sending Emails through vb.net?
I'm guessing you have a problem with your sending server, I don't think the problem is in this code (some parts of it are elipsed, so I can't say for sure, but it looks right). If the messages are in the queue then I would say the server is not sending them.
Reply:I think that your problem is that your server is not configured yet.You see "System.Web.Mail.SmtpMail.SmtpS... = "127.0.0.1"", taht means that you use as smtp server your local server, 127.0.0.1 is the local server's IP.I don-t know how you can configure this server on windows servers but I sugest you to use google.there you must find something
Reply:reinstall your windows or linux.I`m sure you are virused%26gt;%26gt;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment