سلام و خسته نباشید دوستان من روی سایتم دستورات ارسال ایمیل قرار دادم با SMTP جمیل جواب گرفتم و ایمیل ارسال شد بدون مشکل ولی الان با Cpanel که ایمیل دارم و سعی دارم ایمیل ارسال کنم نمیشه کم آوردم.
دستور ارسال ایمیل بنده
SmtpClient client = new SmtpClient
{
Port = Port,
Host = SMTP.Trim(),
EnableSsl = true,
Timeout = 10000,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false
};
StringEncryptor.PlainText = E_Password.Trim();
client.Credentials = new System.Net.NetworkCredential(E_Emial.Trim(), StringEncryptor.DecryptText);
MailMessage mm = new MailMessage(E_Emial.Trim(), TO.Trim(), Subject.Trim(), Message.Trim())
{
BodyEncoding = UTF8Encoding.UTF8,
IsBodyHtml = true,
DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
};
client.Send(mm);
باقی اطلاعات از دیتابیس ارسال و جایگزین میشه که مقادیر این ها هستن.رمز هم بهش دادم و همین طور عنواع پورت رو هم بهش دادم.
ولی این خطا رو به هم میده.
Failure sending mail. |
Failure sending mail. |
Failure sending mail. |
The operation has timed out. |
The operation has timed out. |
The operation has timed out. |
The operation has timed out. |
Failure sending mail. |
Failure sending mail. |
Failure sending mail. |
Failure sending mail. |
Failure sending mail. |
Syntax error, command unrecognized. The server response was: Dovecot ready. |
Failure sending mail. |
The operation has timed out. |
بابت هر پورت که دادم این خطا ها رو داده.