Developer forum

Forum » Development » Mails not send through Email.SendMail

Mails not send through Email.SendMail

Jonas Mersholm
Reply

Hi.

We are experiencing some trouble since mails are not sent using the: Dynamicweb.Modules.Common.Email.SendMail method. 

EmailMarketing mails are correctly send and received in the mailboxes, but attempting to send through Dynamicweb.Modules.Common.Email.SendMail simply just does nothing. 

The solution-SMTP is set to:

smtp-s001c.dynamic-systems.lan

 

Any ideas?

 

Jm


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Jonas,

EmailMarketing does not use this method to send emails. If you want to send a Dynamicweb.Modules.EmailMarketing.Email object, you should use the Dynamicweb.Modules.EmailMarketing.Email.SendEmail(Email mail) method to do it. If you want to send a System.Net.Mail.MailMessage object, you should use one of the Dynamicweb.EmailHandler.Send overloads. I would not recommend using Dynamicweb.Modules.Common.Email.SendMail, but use one of the above mentioned methods.

I think the reason EmailMarketing is capable of sending and this method is not, is because the smtp is incorrect. EmailMarketing uses EmailHandler under the covers, and this methods falls back to a default smtp server if it can't send using the one that's specified. I assume your solution is hosted at HostNordic, and your smtp server should, therefore, be smtp.dynamic-systems.lan.

- Jeppe

Votes for this answer: 1
 
Jonas Mersholm
Reply

Thank you Jeppe. That did the trick.

 

You must be logged in to post in the forum