Monday, March 26, 2012

SMTP SERVER problem - need help

Hi...

I am hosting my files at webmatrixhosting.net. It's free trial. I read this article
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=365392 about Email. It said that I need to put my web site name for SmtpMail.SmtpServer ( SmtpMail.SmtpServer="http://meme30.europe.webmatrixhosting.net/";) but it doesn't work.
The following is my code:


public void SendMail (object sender, EventArgs E)
{

MailMessage mailNew = new MailMessage();
mailNew.From = FromText.Text;
mailNew.To = ToText.Text;

mailNew.Subject = "Check out Moose Mountain Hottubs Site";
mailNew.BodyFormat = MailFormat.Html;
mailNew.Body = "<HTML><HEAD></HEAD><BODY><p>Your friend visit our web site and thought you would like to read it. The link is listed below:<A HREF=\"http://www.moosemountainhottubs.com\">www.moosemountainhottubs.com</p></BODY></HTML>";
SmtpMail.SmtpServer="http://meme30.europe.webmatrixhosting.net/";

try{
SmtpMail.Send(mailNew);
Response.Write("<scr" + "ipt type=\"text/javascript\">alert('This site link was sent to recepient');</scr" + "ipt>" );
}
catch (Exception exc){
Response.Write("<scr" + "ipt type=\"text/javascript\">alert('Send failure, please try again later');</scr" + "ipt>");
}

ToText.Text="";
FromText.Text="";

}

is there anybody can help me with this?

TIAin that post - it says to put your DOMAIN name in . Thats if it was your domain . this is not -.
You need the address of a smtp server ( smtp.somedomain.com) .The smtp server must allow relaying from your webhost. Maybe your web host has a smtp server you can use.
The smtp.server name has to be a real SMTP server. If you put any smtp server in, and relaying is not allowed ( this is common) your mail won't go through. The post you looked at is for a locally run domain. Check with webmatrixhosting. They probably have a server at mail.webmatrixhosting.com - thats what you would put in ( try it first - can't hurt)
Hope that helps
Yes, you're right!

I will try now.

thanks

0 comments:

Post a Comment