By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

Send mail attachment

P: n/a
I've created a web service in .Net v2 that takes a couple of parameters
(ie; to address, subject and body) that sends an email.

I now want to extend this so that it can send attachments (ie; a PDF).
Is this possible? If so, how does one go about doing it?
Hope someone can help me out here.

Thanks in advance......

Feb 16 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I forgot to mention, that I'm accessing the webservice from a windows
form application.

Feb 16 '06 #2

P: n/a
Hi,
"Code Monkey" <dl********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've created a web service in .Net v2 that takes a couple of parameters
(ie; to address, subject and body) that sends an email.

I now want to extend this so that it can send attachments (ie; a PDF).
Is this possible? If so, how does one go about doing it?


It is possible, all you have to do is send the file to the webservice, you
could load the file in a byte[] and then send this array. once in the server
side you recreate the file and attach it as usual.

I don't have code here with me, but it should be plain simple


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 16 '06 #3

P: n/a
Hi Code Monkey,

Create and pass along MailAttachment objects. They are serializable.
Unfortunately they expect the file to exist on the filesystem on your side
(WinForm) so may be clunky if you already have the body in a byte stream.

Best personal regards,
-- Li-fan

--
Li-fan Chen
Software analyst/developer, Entrepreneur
Markham, Ontario, Canada
"Code Monkey" <dl********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I've created a web service in .Net v2 that takes a couple of parameters
(ie; to address, subject and body) that sends an email.

I now want to extend this so that it can send attachments (ie; a PDF).
Is this possible? If so, how does one go about doing it?
Hope someone can help me out here.

Thanks in advance......

Feb 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.