Reputation: 479
I'm trying to send and Email to somebody, but I faced to problem. Actually I'm working with C# .Net and my code body is here as follows:
using System.Net;
using System.Net.Mail;
SmtpClient SMTPClientObj = new SmtpClient();
SMTPClientObj.UseDefaultCredentials = false;
SMTPClientObj.Credentials = new NetworkCredential("[email protected]", "Admin password");
SMTPClientObj.Host = "Mail.inno-tech.com";
SMTPClientObj.Port = 587;
SMTPClientObj.EnableSsl = true;
SMTPClientObj.Send("[email protected]", "[email protected]", "test", "this is test")
I faced to "Server does not support secure connections" problem. when I used this code
SmtpClient smtpClient = new SmtpClient();
NetworkCredential basicCredential =new NetworkCredential("admin", "admin Password", "Mail.inno - tech.com");
MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress("[email protected]");
smtpClient.Host = "Mail.inno-tech.com";
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = basicCredential;
message.From = fromAddress;
message.Subject = "your subject";
message.IsBodyHtml = true;
message.Body = "<h1>your message body</h1>";
message.To.Add("[email protected]");
try
{
smtpClient.Send(message);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
I faced to this problem "Mailbox unavailable. The server response was: No such user here" .
It seems that [email protected] in not valid for Host address(Mail.inno - tech.com). As a matter of fact, my problem is I can not send an Email from all mail boxes to all any other mail boxes. I just can send an Email from all mail boxes to Email addresses which are valid for my host address(Mail.inno - tech.com). I wonder whether I should set some setting as a configuration setting in which I define for Host to accept all mail addresses as a receiver or there is other solution to solve it.
In advance I really appreciate you for your help.
Upvotes: 0
Views: 294
Reputation: 752
Well, it seems that your mail is being sent out properly, the problem probably lies in configuration of SMTP server. If you're into fixing it, you should enable mail relay (at least for mail sent from your host, for example).
So technically it's a "contact your SMTP server administrator" problem :) If you're the administrator, then do what admins do (consider the documentation).
(BTW. I just realized that if the e-mail [email protected] does not exist (is misspelled or mis-CaSed), the response you're getting is correct and there's no other problem to solve)
Upvotes: 1