Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi Frnds,
I have problem with smtp server.I AM ABLE TO SEND MAIL FROM MY LOCAL SERVER.However when I upload the files to server am getting the below error.
'Cannot Get IIS Pickup Directory'
please help me soon.My code is below.once again I remember u its working fine in my local system.
 

SmtpClient mail_client = new SmtpClient();
mail_client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis;
System.Net.NetworkCredential network_cdr = new System.Net.NetworkCredential();
network_cdr.UserName = uname;
network_cdr.Password = pwd;
 
mail_client.Credentials = network_cdr;
mail_client.Port = 26;
mail_client.Host = mailhost;
mail_client.Send(email_msg);
Posted 23-Nov-12 0:57am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hey Radhika i was getting same error on windows server 2008 R2 when i write belove code i got sollution.. use Gmail smtp client
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new Net.NetworkCredential("xyz@gmail.com", "password");
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.gmail.com";
SmtpServer.EnableSsl = true;
 
mail = new MailMessage();
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mail.ReplyTo = new MailAddress(TextBox1.Text);
SmtpServer.Send(mail);
Hope this will work for u...Kishan Ki Radha jI...
  Permalink  
v2
Comments
Radhika Vyas at 28-Nov-12 7:33am
   
I cant use gmail authentication..I need to use smtp details of client..Ur code is not working for me
Devang Vaja at 28-Nov-12 8:18am
   
hey by this code u can send on client Email id but This mail will go through Your gmail account and it is smtp client code but uses only gmail authentication that's difference Radha ji..
Have u tried this code???
Devang Vaja at 29-Nov-12 0:22am
   
MailMessage MyMsg = default(MailMessage);
 
SmtpClient MySmtp = default(SmtpClient);string StrTo = null;
 
string StrFrom = null;string StrSubject = null;string StrBody = null;
 
string StrTMsg = null;try { StrTo = StrTTo; StrFrom = "coolrocker.vaja@gmail.com";
 
StrSubject = StrTSub; StrTMsg = ""; StrTMsg = S.ToString; StrBody = StrTMsg;
 
MyMsg = new MailMessage(StrFrom, StrTo, StrSubject, StrBody);
 
MyMsg.IsBodyHtml = true; MySmtp = new SmtpClient("localhost");
 
MySmtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
 
MySmtp.Send(MyMsg);} catch (Exception ex) {}Use This
abhi10 at 6-Sep-14 6:11am
   
Hi Frnds,
I have problem with smtp server.I can't ABLE TO SEND MAIL FROM MY LOCAL SERVER. I am getting the below error.
'Cannot Get IIS Pickup Directory'
please help me soon.My code is below.once again I remember u its working fine in my local system.

 

SmtpClient sc = new SmtpClient("localhost");
sc.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
sc.Send(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMsg.Text);
lblShow.Text = "Mail Sent Sucessfully";

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



Advertise | Privacy | Mobile
Web03 | 2.8.141022.2 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100