G
Guest
Hi,
I'm using this code for sending emails and its working fine because I had
configured SMTP in my machine in IIS.
now I'm using machine as a server for this application. but when running the
same application from other machine the email process is not working.
so, do I have to configure and install SMTP in all client machine to get it
working!? or should it be enough just to set it in the server machine?
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);
Thanks
I'm using this code for sending emails and its working fine because I had
configured SMTP in my machine in IIS.
now I'm using machine as a server for this application. but when running the
same application from other machine the email process is not working.
so, do I have to configure and install SMTP in all client machine to get it
working!? or should it be enough just to set it in the server machine?
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);
Thanks