Sending email from VB Windows Forms Application, NET 3.5

  • Thread starter Thread starter Chip Pearson
  • Start date Start date
C

Chip Pearson

I am building a VBNET Windows Forms application in VS2008 using NET
3.5. I want the user to be able to send an email to the recipient of
his choosing. However, I don't want to require that the user provide
his password and SMTP server name (either during the app setup
configuration at installation or on the fly at run time) to send the
mail. I don't want to automate Outlook to send the mail since I
cannot be sure that the user will in fact have Outlook on his machine.

I've done it in other apps using CDO, but I want to keep the app "pure
NET" and I couldn't find equivalents to the CDO functions in NET 3.5.

Is there a way to send an email (with an attachment) in the case where
both the recipient and sender are not known until run time without
requiring the password and SMTP server name? (I'm assuming that the
user won't know what an SMTP server is, let alone what his is named.)

Any suggestions would be most appreciated. Thank you very much.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
If you don't want to use smtp and invoke CDO, then I suggest you write a
"service" that will allow you to send emails.
A quick and easy webservice is the fastest to code. but not very robust.

I would check this:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry

Writing a WCF service to handle email requests wouldn't be that hard.
If you want file attaching, then you're gonna have to send the file over to
the service as a stream or something.


You're basically writing a middleman email service. And the WCF will invoke
the dotnet email code.

You can check this out as well:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry
 
Back
Top