473,387 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

HOWTO: Send an email w/ attachment?

Sam
Hi,

I want to be able to send an email w/ attachment. I have an INPUT
Type="File" HTMLControl on the page. User selects the attachment using this
control.

That's where I'm stuck. First, I want to check to see if the user selected
an attachment. If not, I shouldn't worry about declaring and dealing w/
MailAttachment.

If there is an attachment, do I have to upload the file to the server first?
Can I grab it from the client's machine and attach it directly?

All the examples I found on the net are pretty lame. They all grab the file
from the C:\ drive. That's not a real life situation.

I'd really appreciate some examples -- preferably in C#.

Thanks,

Sam
Nov 18 '05 #1
1 1430
Sam
Is that the only way to do it? Do you then delete the file from the Temp
folder?

Sam

"Tu-Thach" <tu*****@ongtech.com> wrote in message
news:89**********************************@microsof t.com...
Sam,
I have done this in the past. What I do is upload the file to a temporary folder on the web server. Then from there, create a mail message and add
MailAttachment.
Tu-Thach

----- Sam wrote: -----

Hi,

I want to be able to send an email w/ attachment. I have an INPUT
Type="File" HTMLControl on the page. User selects the attachment using this control.

That's where I'm stuck. First, I want to check to see if the user selected an attachment. If not, I shouldn't worry about declaring and dealing w/ MailAttachment.

If there is an attachment, do I have to upload the file to the server first? Can I grab it from the client's machine and attach it directly?

All the examples I found on the net are pretty lame. They all grab the file from the C:\ drive. That's not a real life situation.

I'd really appreciate some examples -- preferably in C#.

Thanks,

Sam

Nov 18 '05 #2

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

Similar topics

16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
8
by: John Brock | last post by:
I am currently using a VB.NET program to send out e-mails with plain text bodies (plus one attachment). The emails are being received as Rich Text messages (probably just my personal Outlook...
4
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
3
by: sentiboy | last post by:
I am using the following code for sending email through mapi in VS 2005 environment: Public objSession As New MSMAPI.MAPISession Public objMessage As New MSMAPI.MAPIMessages ...
3
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi There, I use follow code to send email inside VB.NET 2005. It does not work well. Error message of "Failure sending email" would occue. However, email was sent out sometimes. I am confused...
1
by: shil | last post by:
Hi, I'm using FW 2.0 to send an email with an attachment using System.Net.Mail class. If I try to attach a file from my file system, I could successfully send the eamil. But I need to generate a...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi Guys, I'm using this code to send an email with attachment but it's not working !! So, what I'm missing!!? knowing that both From & To email addresses are correct? MailMessage msgMail =...
1
by: sxwend | last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.