الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيفيفة اضافة ملف مرفق للميل

مغلق
بدأه hend في 29 نوفمبر 2005 · 2 رد · 659 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Error in attaching a file with the email in ASP.Net?

1- I decleare a public variable of type MailAttachment with name objMailAttachment.

2- I add a file field (HTML Control) to the form, named it fileAttach.

3- I write this code in send button Sub:

Dim mail As New MailMessage

mail.From = "itcenteronline@yahoo.com"

mail.To = txtmail.Text

mail.Subject = txtSubject.Text

mail.Body = txtBody.Text

If fileAttach.PostedFile.ContentLength <> 0 Then

objMailAttachment = New MailAttachment(fileAttach.PostedFile.FileName)

mail.Attachments.Add(objMailAttachment)

End If

SmtpMail.Send(mail)

So what is wrong?????????

#2

يجب أن يتم رفع الملف أولا على السيرفر ومن ثم تضعينه رابط الوصول اليه في كود الايميل ،أما مباشرة من جهازك اعتقد لا يجوز.

MCP

MCTS:.Net Framework 2.0: Web Applications

MCPD:Web Developer

#3

hi

yes you must first upload the file to the server and then u can acsses its contenet

if you cant do thats tell me and i will help you

هذا الموضوع مغلق.

مواضيع مشابهة