abhi
abhi

Reputation: 253

SMTP error for sending an email?

I am getting following error while sending an email from the contact us form of a website

System.Net.Mail.SmtpException: Cannot get IIS pickup directory. at System.Net.Mail.IisPickupDirectory.GetPickupDirectory() at System.Net.Mail.SmtpClient.Send(MailMessage message) at UICBLL.Mail.MailSettings.SendMail(String ToAddress, String CCAddress, String BccAddress, String SubjectText, String BodyText, Boolean IsBodyHtml, MailPriority mailPriority, String[] MailAttachment) at UICPresentation.Forms.Client.contact.sendMail()

Any ideas? I can not get hold of an IIS as this is a shared hosting. Any work around?

Upvotes: 2

Views: 770

Answers (1)

Nate
Nate

Reputation: 1669

What does your code/web.config look like?

Without seeing that, do you have the pickup directory specified? For example:

SmtpClient client = new SmtpClient(hostName);
client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;

Upvotes: 1

Related Questions