Difference between DotNetNuke.Services.Mail.Mail.SendEmail and DotNetNuke.Services.Mail.Mail.SendMail

I want to send an email after the registration process in the DNN module. When I searched, I found that there is a built-in zip class in dnn. But it contains two methods: SendEmail and SendMail . What is the difference between the two? And which one should I choose in this case.

+6
source share
3 answers

SendEmail was introduced in DNN 5.3 and greatly simplifies the API. If you can use the SendEmail method, I would recommend it much easier than SendMail (which always requires SMTP information, although it is almost always extracted from the settings).

If you are looking

  • from
  • in
  • Headline
  • Body

with additional

  • sender
  • attachments

then SendEmail is what you want.

+10
source

I think SendMail internally refers to the SendEmail parameter for sending mail. Check their settings for more details and use the one that suits your situation.

 DotNetNuke.Services.Mail.Mail.SendEmail(String fromAddress, String senderAddress, String toAddress, String subject, String body) DotNetNuke.Services.Mail.Mail.SendMail(UserInfo user, MessageType msgType, PortalSettings settings) 

Thanks!

+2
source

To extend the answer to bdukes ...

SendEmail () is great for sending basic emails.

SendMail () is great for sending emails where you need to access additional options. . Functions such as CC addresses, BCC addresses, and body style can be set using this function. A function call looks a lot more complicated, but apart from a few additional parameters, there is nothing difficult to use SendMail (), so do not despair if you need to configure a call features take an extra minute.

When using SendMail (), if blank lines are used for SMTP parameters, the function will use the DNN SMTP settings.

Here is a short article by Chris Hammond that shows how easy it is to use SendMail (), http://weblogs.asp.net/christoc/archive/2006/06/23/DotNetNuke-Daily-Tip-6_2D00_23_2D00_06.aspx

+2
source

Source: https://habr.com/ru/post/886451/


All Articles