0

i have attached the code here:

string from = "name@comapanydomain.com";

string to = "name@comapanydomain.com";
string subject = "Employer request form";
string body = "body";
string senderEmail = "un";
string senderPassword = "password";


MailMessage o = new MailMessage(from, to, subject, body.ToString());
NetworkCredential netCred = new NetworkCredential(senderEmail, senderPassword);
SmtpClient smtpobj = new SmtpClient();
smtpobj.Host = "ip address(e.g:192.232.122.232)";
smtpobj.Port = 25;

smtpobj.EnableSsl = false;
smtpobj.UseDefaultCredentials = true;
smtpobj.Credentials = netCred;
smtpobj.Send(o);

The email service provider ->rapid cloud and domain name provider -> godaddy.

the email config was provided by rapid cloud , the config works with outlook when sending email but not in website. I have attached the error as well.Please assist. error that i am getting:An existing connection was forcibly closed by the remote hostThank you

1 Answers1

0

Please double check the port number. It may be something other than 25

User555
  • 83
  • 1
  • 9
  • Ive already checked in telnet.it does give response..and it works in outlook as well..would it be error in the code...?is there any other suggestion in implementing this? – hello friends Aug 06 '17 at 08:21