本文介绍了发送电子邮件失败。无法获取IIS拾取目录。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Hello Friend, 我的要求是我想发送包含图片和一些链接的特定格式的电子邮件。 所以我实现了所有内容。本地系统。但部署后没有工作。有以下错误 Hello Friend,My requirement is I want to send Email with specific format which contain Images and some links. So I implement everything.such code worked on my local system. but not worked after deployment.there have following error Send Email Failed. Cannot get IIS pickup directory. 那么在这种情况下我该怎么办。 如果是服务器端问题那么IIS的要求是什么服务器端的版本。So What can I do in such scenario.If it is server side problem then what is requirement for IIS version on server side.推荐答案 using System.Text;using System.Data;using System.Configuration;using System.Net; protected void Page_Load(object sender, EventArgs e) {} private void SendAcknowledgementMail(string FGPResult) { NetworkCredential smtpCreds= new System.Net.NetworkCredential("[email protected]","Pass"); objemail.To.Add("[email protected]"); objemail.From = new MailAddress("[email protected]"); objemail.Subject = "Test Email Sending"; var message = new StringBuilder(); message.Append(txt_UserName.Text; objemail.Body = message.ToString(); message.Append(User Name); } try { System.Net.Mail.SmtpClient objSmtpClient = new SmtpClient("smtp.gmail.com"); objSmtpClient.UseDefaultCredentials = false; objSmtpClient.EnableSsl = true; objSmtpClient.Credentials = smtpCreds; objSmtpClient.Port = 587; if (!string.IsNullOrEmpty(objSmtpClient.TargetName)) { objSmtpClient.Send(objemail); lbl_msg.Text = "* Email Send ." ; } } 这篇关于发送电子邮件失败。无法获取IIS拾取目录。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-23 05:29