Emailing from a Visual Studio.NET Application (Basic)

G

Guest

I'm sending eMail messages from my Visual Basic.NET application. Creating a
System.Web.Mail.MailMessage and sending it with SmtpMail.Send works fine, but
I'd like to take it a step further and hook up with the correct Mail Server
automatically, or, even better, deliver the message into the client´s actual
eMail application so he can use his address book to select the recipient,
etc. Can anyone point me in the right direction? At least as far as telling
me how to get the name of the Mail Server, if any, that the user is hooked up
with. As far as plugging into the Mail-client the user is using, perhaps
that's a lot of bother since the different clients ,Outlook, Outlook Express,
and (I shudder to mention it) Non-Microsoft mail clients may not accept the
same type of Message-object. Still, I'd be grateful for any input.
 
J

Jeffrey Tan[MSFT]

Hi Gudmundur,

Based on my understanding, you want to leverage the mail client installed
on your machine to send email.

For this issue, we need not use System.Web.Mail namespace. We should
leverage the programming interface exposed by the application. For other
non-microsoft email client, I think you should refer to the document of
that product. Microsoft has 2 mail clients: Outlook Express and Outlook.

For Outlook, we can use automation to invoke it to send mail. Please refer
to below link:
"An Introduction to Programming Outlook 2003 Using C#"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechar
t/html/ol03csharp.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaol11/htm
l/olmthSend.asp

For Outlook Express, we can not use the automation.
==========================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Gudmundur,
I wouldn't use Automation unless you want only to support Outlook. The
object model for different mail clients will be different, if they exist at
all (Outlook Express doesn't support Automation). Plus the object models
differ between versions of Outlook.

Have a look at Simple MAPI or CDO (also known as Extended MAPI). Simple
MAPI is older and has less functionality (but is supported by Outlook
Express). CDO has a more functionality but isn't supported by Outlook Express.

If I had to choose I would probably use Simple MAPI. Have a look at
http://msdn.microsoft.com/library/d...us/mapi/html/_mapi1book_about_simple_mapi.asp

Regards,
Phil.
 
J

Jeffrey Tan[MSFT]

Oh, yes, office automation is only suitable for Microsoft OutLook, because
this is the common programming interface exposed by Outlook.

For other products, just as Phil suggested, many of them have implemented
MAPI, so normally we can leverage the MAPI to inovke the mail client
function to send email. But microsoft does not guarantee these third party
mail client's implementation.

Thanks Phil for sharing information!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top