how to send mail in asp.net by server ip

Posted by Shanky11 under ASP.NET on 7/25/2013 | Points: 10 | Views : 1674 | Status : [Member] | Replies : 2
i have created a website
in query form i am sending the details to mail id
this is demo code...i am using like this no error is coming lable is showing the message
but the mail is not going
what else can i do????
MailMessage mail = new MailMessage();
mail.To.Add("bis@gmail.com");
mail.From = new MailAddress("demo@bhavyainfosoft.com");
mail.Subject = "Test mail";
mail.Body = TextBox2.Text;
mail.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("demo@bhavyainfosoft.com", "sdawqe2");
client.Host ="66.198.252.156";
client.EnableSsl = false;
client.Send(mail);
lblmessage.Visible = true;
lblmessage.Text = "Mail sent successfully.";




Responses

Posted by: Raj.Trivedi on: 7/26/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello shanky

The host has to be in smtp format

it should have smtp.domian.com

You cannot have an IP address in that place.

That is the issue

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 7/30/2013 [Member] Starter | Points: 25

Up
0
Down
hi
refer this link it might be help ful to you
http://forums.asp.net/t/1726456.aspx/1


Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response