471,305 Members | 1,296 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Send mail attachment

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
3 1922
I forgot to mention, that I'm accessing the webservice from a windows
form application.

Feb 16 '06 #2
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
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.

Similar topics

2 posts views Thread by Cimento Cola | last post: by
reply views Thread by rosydwin | last post: by

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.