SMTP Send creates *.eml file but does not dispatch email

A

AA2e72E

I am having some difficulty understanding what is happening here:

..... code snippet

SmtpClient client = new
SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
client.UseDefaultCredentials = true;
if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
{
Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STATIONID);
}
client.PickupDirectoryLocation = LogFolder + @"\" + thisEmail.STATIONID;
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
MailMessage mailMessage = new MailMessage();
// properties of mailMessage set here e.g From, To, Subject etc
client.Send(mailMessage);

..... after the last statement, I find that an *.eml file is deposited in the
appropriate folder BUT no email is dispatched.

I am missing something; any help in identifying what that is?

Thanks.
 
A

Alexey Smirnov

I am having some difficulty understanding what is happening here:

.... code snippet

SmtpClient client = new
SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
client.UseDefaultCredentials = true;
if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
    {
       Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STATIONID);
    }
client.PickupDirectoryLocation = LogFolder + @"\" + thisEmail.STATIONID;
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;  
MailMessage mailMessage = new MailMessage();
// properties of mailMessage set here e.g From, To, Subject etc
client.Send(mailMessage);

.... after the last statement, I find that an *.eml file is deposited in the
appropriate folder BUT no email is dispatched.

I am missing something; any help in identifying what that is?

Thanks.

SmtpDeliveryMethod.SpecifiedPickupDirectory specifies the directory
where applications save e-mail for later processing by the SMTP
server. So, check if SMTP server is correctly configured.
 
A

AA2e72E

Thanks Alexey.

I need some hints: how do I get to what I am looking for and what am I
looking for? Are these the properties of the instance of the smtpclient?

Alexey Smirnov said:
I am having some difficulty understanding what is happening here:

.... code snippet

SmtpClient client = new
SmtpClient(ConfigurationManager.AppSettings["Default_mailClient"]);
client.UseDefaultCredentials = true;
if (!Directory.Exists(LogFolder + @"\" + thisEmail.STATIONID))
{
Directory.CreateDirectory(LogFolder + @"\" + thisEmail.STATIONID);
}
client.PickupDirectoryLocation = LogFolder + @"\" + thisEmail.STATIONID;
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
MailMessage mailMessage = new MailMessage();
// properties of mailMessage set here e.g From, To, Subject etc
client.Send(mailMessage);

.... after the last statement, I find that an *.eml file is deposited in the
appropriate folder BUT no email is dispatched.

I am missing something; any help in identifying what that is?

Thanks.

SmtpDeliveryMethod.SpecifiedPickupDirectory specifies the directory
where applications save e-mail for later processing by the SMTP
server. So, check if SMTP server is correctly configured.
.
 

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