The first thing is to do SMTP server settings.
Steps of SMTP server settings are as follow:
1.Login in your portal with super user account
2.Go to host->host settings->Advanced Settings->SMTP Server Settings
3.Fill details : Fill server name:Port
4.Select SMTP Authentication->Basic
5.Select SMTP Enable SSL
6.Fill SMTP username and password.
Now you can test SMTP settings.If all things are fill right the message is displayed: "Email Sent Successfully".
Now in the code you write:
string emailError = string.Empty;
emailError = DNNEmailServices.Mail.SendMail(emailFrom, emailTo, emailcc,emailbcc, DNNEmailServices.MailPriority.Normal, emailSubject, DNNEmailServices.MailFormat.Html, Encoding.Default, emailBody, "", "", "", "", "");
If emailError is blank that means no error occur and email sent successfully otherwise there is some problem sending email.
0 Comment(s)