Author |
|
sysdemo Newbie
Joined: 11 April 2014 Location: United States
Online Status: Offline Posts: 2
|
Posted: 11 April 2014 at 1:27am | IP Logged
|
|
|
why >????
[15:22:18.07] [RECV] 550 relay not permitted\r\n
[15:22:18.20] [INFO] Error: The server rejected the given recipient. The server responded: 550 relay not permitted.
Smtp mailer = new Smtp();
//SmtpServer server = new SmtpServer(SmtpServerIp, int.Parse(port), 1, 30, false, MailBee.AuthenticationMethods.Auto, username, password, false, SmtpServerIp, ExtendedSmtpOptions.NoChunking);
SmtpServer server = new SmtpServer(SmtpServerIp);
server.AccountName = username;
server.Password = password;
server.Port = int.Parse(port);
server.SmtpOptions = ExtendedSmtpOptions.NoChunking;
server.IgnoreLoginFailure = true;
if (EnableSSL)
{
server.SslProtocol =SecurityProtocol.Ssl3;
}
switch (ProxyWay)
{
case "HTTP":
server.Proxy.Protocol = ProxyProtocol.Http;
server.Proxy.Name = proxyIp;
server.Proxy.Port = int.Parse(proxyPort);
server.Proxy.AccountName = proxyUid;
server.Proxy.Password = proxyPwd;
break;
case "SOCKS4":
server.Proxy.Protocol = ProxyProtocol.Socks4;
server.Proxy.Name = proxyIp;
server.Proxy.Port = int.Parse(proxyPort);
break;
case "SOCKS5":
server.Proxy.Protocol = ProxyProtocol.Socks5;
server.Proxy.Name = proxyIp;
server.Proxy.Port = int.Parse(proxyPort);
server.Proxy.AccountName = proxyUid;
server.Proxy.Password = proxyPwd;
break;
default:
break;
}
mailer.SmtpServers.Add(server);
MailBee.Mime.MailMessage msg = new MailBee.Mime.MailMessage();
if (charSet != "")
{
msg.Charset = charSet;
}
String[] addr = To.Split(',');
if (sendWay == "TO")
{
for (Byte i = 0; i < addr.Length; i++)
{
if (addr != "")
{
msg.To.Add(addr);
}
}
}
else if (sendWay == "CC")
{
for (Byte i = 0; i < addr.Length; i++)
{
if (addr != "")
{
msg.Cc.Add(addr);
}
}
}
else
{
for (Byte i = 0; i < addr.Length; i++)
{
if (addr != "")
{
msg.Bcc.Add(addr);
}
}
}
if (from == "")
{
from = username;
}
msg.From = new MailBee.Mime.EmailAddress(from, SendUsername);
msg.Subject = Subject;
msg.ReplyTo.Add(replyTo,SendUsername);
if (isHtml)
{
msg.BodyHtmlText = Body;
msg.MailTransferEncodingHtml = MailTransferEncoding.QuotedPrintable;
//msg.Attachments.Add("", "Top.jpg", "123");
if (dicEmailImg != null && dicEmailImg.Count > 0)
{
foreach (string key in dicEmailImg.Keys)
{
string filename = dicEmailImg[key].Replace("%20", " ");
if (!filename.Contains("http://"))
{
msg.Atta chments.Add(filename,"",key);
}
else
{
msg.Body HtmlText = msg.BodyHtmlText.Replace("cid:" + key, dicEmailImg[key].Replace("%20", " "));
}
}
}
}
else
{
msg.MailTransferEncodingPlain = MailTransferEncoding.QuotedPrintable;
msg.BodyPlainText = Body;
}
if (listFile != null)
{
for (int i = 0; i < listFile.Count; i++)
{
msg.Attachments.Add(listFile);
}
}
mailer.Message = msg;
mailer.Log.Enabled = true;
mailer.Log.Filename = @"C:\log.txt";
return mailer.Send();
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 11 April 2014 at 3:35am | IP Logged
|
|
|
The response from server means SMTP authentication was not enabled, and checking the code confirms that. You need to supply SmtpServer.AuthMethods value, otherwise SMTP auth is disabled and username/password values are ignored.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
sysdemo Newbie
Joined: 11 April 2014 Location: United States
Online Status: Offline Posts: 2
|
Posted: 11 April 2014 at 3:46am | IP Logged
|
|
|
Thanks
|
Back to Top |
|
|