Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

How can I programmatically send email using Windows Live Mail from within VB .NET?

Why do want to do this?

I have tried writing a program for this in the recent past using VB .NET. It required me to format the message into HTML which was not elegant. I had to paste the Word file into FrontPage and then copy the text in the HTML tab into a text box on the message form. I needed to do some additional programming to ensure that the logo would be seen by all recipients. The image of the logo had to be embedded in the message to make this happen. This required me to programmatically edit the HTML coded message to change the image reference to the embedded image code. Is is not easy to programmitically edit HTML text accurately.

I am the only one doing the mailing and I'm using WLM to do it. Using proprietary software is just not an issue here. I copy the recipient addresses into the BCC manually to avoid exposing them to all the other recipients. But because WLM doesn't let me show only the BCC field, I can paste the addresses into the CC field by mistake without knowing it. I already did this once and it was not well received. If I can pragrammatically paste in the addresses, I would not make this mistake again, because I would write the code to update only the BCC field.

We do not want to send a Word or rich text doc as an attachment. The message has to be in the body and look like the original Word doc too. WLM has no problem doing this manually. Everyone receives the message looking like we want to look. If I can use VB .NET to ensure I use only the BCC, it would make the process more accurate and keep all the recipients happy.

I hope I have provided all the background to my question and made easier to answer.

Thanks,

Mike
Posted
Updated 17-Sep-13 6:00am
v2

1 solution

I don't think it may make any sense at all. Isn't it an attempt to use regular user's approach instead of programmer's? Direct sending of mail is millions times simpler and more robust.

Please see my recent answer: Using Windows Live Mail in .NET[^]. (This link is already gone; thank you, Richard.)

You will find all you need if you start from here:
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx[^],
http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.transport.smtpserver%28v=exchg.150%29.aspx[^].

—SA
 
Share this answer
 
v2
Comments
Richard MacCutchan 17-Sep-13 12:26pm    
Link is gone.
Sergey Alexandrovich Kryukov 17-Sep-13 12:53pm    
Ah, thank you very much, Richard; I updated the answer with some direct links to MSDN.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900