Re: System.Web.Mail to send out email from desktop app
- From: David Cho <profnachos@xxxxxxxxx>
- Date: Tue, 10 May 2005 15:13:24 -0700
I solved the problem.
Warning: It is very convoluted.
First,
//not good (but good in ASP.NET)
SmtpMail.SmtpServer = "mail.myserver.com";
//good (don't ask me why)
SmtpMail.SmtpServer.Insert(0, "mail.myserver.com");
Issues with attachments
//Not good (note the relative path)
mail.Attachments.Add(new MailAttachment(@"deathtomicrosoft.txt"));
//good (note the absolute path)
mail.Attachments.Add(new MailAttachment(@"C:\Documents and
Settings\David.SHADOWFAX\My Documents\Visual Studio
Projects\MyProject\bin\Debug\Temp"));
The attachment thing is interesting. When you specify the relative
path, the code does not crash. When you give it a bad file name, it
crashes. So using relative paths SEEMS okay, until you do
SmtpMail.Send.
*** Sent via Developersdex http://www.developersdex.com ***
.
- References:
- System.Web.Mail to send out email from desktop app
- From: David Cho
- System.Web.Mail to send out email from desktop app
- Prev by Date: Keyboard capture problem
- Next by Date: Re: Keyboard capture problem
- Previous by thread: Re: System.Web.Mail to send out email from desktop app
- Next by thread: Process Existance
- Index(es):
Relevant Pages
|