taherisoftware
پنج شنبه 29 تیر 1391, 14:09 عصر
سلام
من با این کد ایمیل می فرستم.می خوام یک فایل رو هم پیوست کنم و همراه ایمیل بفرستم.چجوری این کار رو بکنم؟؟؟
لطفا کد مورد نیاز رو بهش اضافه کنید.
MailMessage _mail = new MailMessage();
SmtpClient _smtp = new SmtpClient();
_smtp.Credentials = new System.Net.NetworkCredential("info@akhazir.ir", "2440160067");
_mail.From = new MailAddress(Sender);
_mail.To.Add(new MailAddress(Reciver));
_mail.Headers.Add("To", Reciver);
//_mail.ReplyTo = new MailAddress(Sender);
_mail.Headers.Add("From", Sender);
_mail.Headers.Add("MIME-Version", "1.0");
_mail.Headers.Add("Content-type", "text/html; charset=UTF-8");
_mail.BodyEncoding = System.Text.Encoding.UTF8;
_mail.Body = Body;
_mail.IsBodyHtml = true;
_mail.Subject = Subject;
_smtp.Host = "mail.akhazir.ir";
_smtp.Send(_mail);
return true;
من با این کد ایمیل می فرستم.می خوام یک فایل رو هم پیوست کنم و همراه ایمیل بفرستم.چجوری این کار رو بکنم؟؟؟
لطفا کد مورد نیاز رو بهش اضافه کنید.
MailMessage _mail = new MailMessage();
SmtpClient _smtp = new SmtpClient();
_smtp.Credentials = new System.Net.NetworkCredential("info@akhazir.ir", "2440160067");
_mail.From = new MailAddress(Sender);
_mail.To.Add(new MailAddress(Reciver));
_mail.Headers.Add("To", Reciver);
//_mail.ReplyTo = new MailAddress(Sender);
_mail.Headers.Add("From", Sender);
_mail.Headers.Add("MIME-Version", "1.0");
_mail.Headers.Add("Content-type", "text/html; charset=UTF-8");
_mail.BodyEncoding = System.Text.Encoding.UTF8;
_mail.Body = Body;
_mail.IsBodyHtml = true;
_mail.Subject = Subject;
_smtp.Host = "mail.akhazir.ir";
_smtp.Send(_mail);
return true;