User sending email attachments?  
Author Message
OldMaps





PostPosted: Thu Apr 21 12:35:10 CDT 2005 Top

ASP.Net >> User sending email attachments? 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.

Web Programming356  
 
 
Kevin





PostPosted: Thu Apr 21 12:35:10 CDT 2005 Top

ASP.Net >> User sending email attachments? 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.

"VB Programmer" <EMail@HideDomain.com> wrote in message
news:%23z%23bx%EMail@HideDomain.com...
>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.
>


 
 
VB





PostPosted: Thu Apr 21 14:22:32 CDT 2005 Top

ASP.Net >> User sending email attachments? Will the MailAttachment namespace upload the attachment automatically from
the users pc to the server? Or, do I have to code this?

Thanks!

"Kevin Spencer" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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.
>
> "VB Programmer" <EMail@HideDomain.com> wrote in message
> news:%23z%23bx%EMail@HideDomain.com...
>>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.
>>
>
>