G
Guest
Hi guys,
I'm using this code to generate emails and it's working in my machine:
// Create the mail message
MailMessage objMailMsg = new MailMessage(strFrom, strTo);
objMailMsg.BodyEncoding = Encoding.UTF8;
objMailMsg.Subject = strSubject;
objMailMsg.Body = strMsg;
Attachment at = new Attachment(Server.MapPath(AttachmentPath));
objMailMsg.Attachments.Add(at);
objMailMsg.Priority = MailPriority.High;
objMailMsg.IsBodyHtml = true;
//prepare to send mail via SMTP transport
SmtpClient objSMTPClient = new SmtpClient();
objSMTPClient.DeliveryMethod =
SmtpDeliveryMethod.PickupDirectoryFromIis;
objSMTPClient.Send(objMailMsg);
But, doing the same thing in other machine(having VS.Net express) the
program is giving me this error:"Cannot get IIS pickup directory"
what could the problem.
Thanks
I'm using this code to generate emails and it's working in my machine:
// Create the mail message
MailMessage objMailMsg = new MailMessage(strFrom, strTo);
objMailMsg.BodyEncoding = Encoding.UTF8;
objMailMsg.Subject = strSubject;
objMailMsg.Body = strMsg;
Attachment at = new Attachment(Server.MapPath(AttachmentPath));
objMailMsg.Attachments.Add(at);
objMailMsg.Priority = MailPriority.High;
objMailMsg.IsBodyHtml = true;
//prepare to send mail via SMTP transport
SmtpClient objSMTPClient = new SmtpClient();
objSMTPClient.DeliveryMethod =
SmtpDeliveryMethod.PickupDirectoryFromIis;
objSMTPClient.Send(objMailMsg);
But, doing the same thing in other machine(having VS.Net express) the
program is giving me this error:"Cannot get IIS pickup directory"
what could the problem.
Thanks