I want to send an email after a registration process in a DNN module. When i searched i found that there is an in-built mail class in dnn. But it contains two methods - SendEmail and SendMail. What is the difference between these two?And which one i have to opt in this case.
SendEmail
was introduced in DNN 5.3, and greatly simplifies the API. If you're able to use the SendEmail
method, I would recommend it, it's much simpler than SendMail
(which always requires SMTP information, even though it's almost always pulled from settings).
If you're looking for
with optional
then SendEmail
is what you want.
To expand on bdukes answer...
SendEmail() is great for sending basic emails.
SendMail() is great for sending emails where you need to access additional options. Things like CC addresses, BCC addresses, and Body Style can be set using this function. The function call looks a lot more complicated, but other than a few additional parameters, there is nothing difficult about using SendMail(), so don't be discouraged if it takes an extra minute to set up the function call.
When using SendMail() if blank strings are used for the SMTP parameters, the function will use the DNN SMTP settings.
Here is a short article by Chris Hammond that shows how simple using SendMail() is, http://weblogs.asp.net/christoc/archive/2006/06/23/DotNetNuke-Daily-Tip-6_2D00_23_2D00_06.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With