Home » questions » Sending Emails through vb.net?

Sending Emails through vb.net?

2006-08-15 06:20:24, Category: Programming & Design
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

Answers

  1. Florin S

    On 2006-08-15 07:13:17


    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
  2. dinosf

    On 2006-08-15 09:18:36


    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.
  3. Catalin4faith

    On 2006-08-15 06:41:08


    reinstall your windows or linux.I`m sure you are virused>>