472,958 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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.
Nov 19 '05 #1
2 1032
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" <xD**********@Dont.com> wrote in message
news:%2********************@TK2MSFTNGP15.phx.gbl.. .
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.

Nov 19 '05 #2
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" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OX**************@TK2MSFTNGP15.phx.gbl...
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" <xD**********@Dont.com> wrote in message
news:%2********************@TK2MSFTNGP15.phx.gbl.. .
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.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
5
by: morphex | last post by:
Hi, I have an email that's in the utf-8 encoding, and I'm getting this error message when I try to send it using smtplib: * Module smtplib, line 688, in sendmail * Module smtplib, line 485,...
4
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
6
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
7
by: Ray Booysen | last post by:
Hi all I'm sending email via ASP.NET in HTML mode. Each email has exactly one attachment and I do have full access to the SMTP server. However, if I send the email in HTML format, the...
3
by: lizii | last post by:
Hey there - hopefully last newbie question i will ask for a while! I want my application to work where you click a button - and it either: a) open a email application - insert the correct email...
0
by: esutcliffe | last post by:
Greetings, How do I close MS Outlook after use reviews the email before sending? I open MS Outlook application and create an email. But at the end of the function I do not Quit Outlook as I...
7
by: Paridevi | last post by:
Hai , i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.