User sending email attachments?

V

VB Programmer

I know how to send emails using ASP.NET. How can I allow the user to attach
a file to an email that they submit (via an ASPX online submission form)?

Ex: Allow user to submit a resume along with their info.
 
K

Kevin Spencer

I'm assuming that the user would attach the file from their own computer? If
so, you would need to have a File Upload control on the form, so that when
they submit the form, the file to attach is sent to the server with it.

In the System.Web.Mail namespace you'll find 3 classes:

SmtpMail
MailMessage
MailAttachment

You would create the MailAttachment from the uploaded file, format a
MailMessage instance, add the MailAttachment to the MailMessage's
Attachments Collection, and use the SmtpMail class to send the MailMessage.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
V

VB Programmer

Will the MailAttachment namespace upload the attachment automatically from
the users pc to the server? Or, do I have to code this?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,153
Latest member
NamKaufman
Top