السلام عليكم ورحمة الله وبركاته
احاول انشاء form للأتصال بنا واستخدم هذا الكد ولكن لا افهم ما المقصود باليوزنيم والباسود (هنا ادخلت اسم المستخدم للحساب المرسل منه الرسالة والباسورد الخاص به )
كما انني اجد الكثير من الاهطاء تظهر مثل time out
او faild
او Transaction failed. The server response was: Transaction failed : Cannot send message due to possible abuse; please visit http://postmaster.yahoo.com/abuse_smtp.html for more information
string smtpAddress = "smtp.mail.yahoo.com";
int portNumber = 587;
bool enableSSL = true;
string emailFrom = textBox1.Text;
string password = "abcdefg";
string emailTo = "to@yahoo.com";
string subject = comboBox1.Text + textBox4.Text + "Jep MData 1.0.0.0";
string body = richTextBox1.Text +
"-------------------------------------------------" +
textBox1.Text + "---------" + textBox2.Text + "---------" + textBox3.Text;
using (MailMessage mail = new MailMessage())
{
mail.From = new MailAddress(emailFrom);
mail.To.Add(emailTo);
mail.Subject = subject;
mail.Body = body;
mail.IsBodyHtml = false;
// Can set to false, if you are sending pure text.
// mail.Attachments.Add(new Attachment("C:\\SomeFile.txt"));
// mail.Attachments.Add(new Attachment("C:\\SomeZip.zip"));
using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber))
{
smtp.Credentials = new NetworkCredential(emailFrom, password);
smtp.EnableSsl = enableSSL;
smtp.Send(mail);
}
}
