C# mail app - mail not sent and ends up in queue folder
I am writing a C# app that uses the SMTP server on my local pc to send email. I can send email normally (throught email client) but mail is not sent using this very simple C# 2.0 code.
No exception is generated
Mail ends up in C:\Inetpub\mailroot\Queue as eml file
Mail not sent - cannot be seen in Outlook after send and recieve clicked to refresh inbox
All email addresses and passwords correct
Here is my code...
Because the message is in the queue it should be ready for sending I would think. Have you verified the outbound queue settings for delivery in SMTP on the server? (e.g. - 10, 15 minutes).
Are you using a smart host in SMTP settings? If so can you send directly to the smart host (telnet to it and send directly for example)?
If just using SMTP from on same machine as IIS try using the following in a vbscript to send directly via cdosys.dll:
begin mail.vbs -->
myMail.Subject="Sending test email with CDOSYS"
myMail.From="email@example.com" 'change to correct address
myMail.To="firstname.lastname@example.org" ' change to correct address
myMail.TextBody="This is a message."
<-- end file
|All times are GMT. The time now is 08:51 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.