Hello Everyone,
I am trying to send an automatic email when user completes a form and hits 'Submit' button.
The following is the code I am trying to use in 'script.js' file. And, I receive the following error.
Any ideas on how to fix the issue? Thanks a million in advance!
Error:
The following error occurred:
Expected ';'
File:script.js
Line:24
MailMessage MailMsg = new MailMessage();
Code:
function SubmitData::OnClick(eventObj)
{
MailMessage MailMsg = new MailMessage();
MailMsg.Body = "Testing ";
MailMsg.From = [email protected];
MailMsg.To = [email protected];
MailMsg.Subject = "InfoPath Test Message";
SmtpMail.SmtpServer = "xxx.xxx.xx";
SmtpMail.Send(MailMsg);
}