Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Using System.net.mail;             
 MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.leadforce.in");
                SmtpServer.Host = "50.97.99.170";
                mail.From = new MailAddress("rajaservice88@gmail.com");
                mail.To.Add(TextBox1.Text);
                mail.Subject = TextBox2.Text;
                mail.Body = TextBox3.Text;
                mail.Priority = MailPriority.High;
                SmtpServer.Port = 25;
                SmtpServer.Credentials = new          System.Net.NetworkCredential("vertex@leadforce.in", "password");
                SmtpServer.EnableSsl = true;
                SmtpServer.Send(mail);
                Label1.Text = "send msg";

I want to send mail throw hostgotor with my site leadforce.in-
host hostgotor smtp details- post-25, host-Host = "50.97.99.170";
with my page email.aspx , But I can't send mail throw my site. Please help me if we have any error in my script, when we say hostgotor , they told me error in my script ,please check it and help me .
Thanks !
Posted
Updated 8-May-12 20:19pm
v2
Comments
P.Salini 9-May-12 2:21am    
are you getting any error while debugging.
krishraja8888 9-May-12 2:34am    
ya its throw error-
System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such user here at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Default2.Button1_Click(Object sender, EventArgs e) in d:\inetpub\vhosts\leadforce.in\httpdocs\sendmail.aspx.cs:line 77
krishraja8888 9-May-12 3:22am    
thanks for help me !.

1 solution

Most probably the problem seems like in the credentials.

But may be this link can help :

http://support.winhost.com/KB/a650/how-to-send-email-in-aspnet.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900