Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

So What can I do in such scenario.
If it is server side problem then what is requirement for IIS version on server side.
Posted
Updated 12-Sep-13 21:24pm
v2

 
Share this answer
 
Comments
Mahesh Swami 13-Sep-13 3:36am    
Yes , such code working on my local system. but after deployment I got such error : Send Email Failed. Cannot get IIS pickup directory.
I think It's IIS version related problem
Finally problem has been resolved.
Namespace :
C#
using System.Text;
using System.Data;
using System.Configuration;
using System.Net;

C#
protected void Page_Load(object sender, EventArgs e)
        {
}

C#
private void SendAcknowledgementMail(string FGPResult)
        {
              NetworkCredential smtpCreds= new System.Net.NetworkCredential("a@gmail.com","Pass");
            objemail.To.Add("Abc@gmail.com");
            objemail.From = new MailAddress("Abc@gmail.com");
            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 ." ;
                }
           }
 
Share this answer
 
Comments
kesav prakash 19-Sep-13 2:31am    
may i know which line u have added to solve the problem
Have you tried this link

Cannot get IIS pickup directory[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900