Hi,
I have used DotNetNuke.Services.Mail class’ sendmail method. I want to send one attachemnt with mail. But simply putting file address in “attachment” parmeter does not work. Can you suggest what should be the attachment parameter?
I have used following code in my project. It sends mail but without subject and without attachment.
Code:
if (FileUpload1.HasFile)
{
string fn = Server.MapPath("upload1") + "\\" + FileUpload1.FileName;
FileUpload1.PostedFile.SaveAs(fn);
string mailFrom = PortalSettings.Email;
string mailTo = WebConfigurationManager.AppSettings["JobApplicationReceipient"];
const string subject = "Job Application form";
string mailBody = EmailBody();
string fnserver = "~/upload1/" + FileUpload1.FileName;
Mail.SendMail(mailFrom, mailTo, "", subject, mailBody, fnserver, "", "", "", "", "");
DisplayMessage("Thanks for applying. We will get back to you shortly.");
}