I am pretty new to DNN, just 1 week old. I am into a project which has a contact form and needs to send email once i click on submit. I have no clue how to go about implementing it, i went through few online codes which suggested to use as specified below....I am not too sure where to add this code, how to call this. Please help...
To send an email in DNN you can use the built in Dotnetnuke API framework. The following code function will do the job
Protected Sub SendMail(ByVal strFrom As String, ByVal strTo As String, ByVal strCC As String, ByVal strBCC As String, ByVal strSubject As String, ByVal strBody As String)
Dim strSMTP As String = DotNetNuke.Entities.Host.HostSettings.GetHostSetting("SMTPServer")
DotNetNuke.Services.Mail.Mail.SendMail(strFrom, strTo, strCC, strBCC, DotNetNuke.Services.Mail.MailPriority.Normal, strSubject, DotNetNuke.Services.Mail.Mailformat.Text, System.Text.Encoding.UTF8, strBody, "", strSMTP, "", "", "")
End Sub
'Sample code
SendMail("fromemail@dnninfo.com","sender@dnninfo.com","","","Email Subject","Email Message")
Remember in order to make it work, you need to setup the SMTPServer in host settings.
(Source : http://www.dnninfo.com/Tutorials/ViewTutorial/tabid/62/smid/378/ArticleID/4/reftab/38/Default.aspx)