here is an example of a very simple mail sending class. You may wish to check
this code against the code that you are using:
using System.Net.Mail;
namespace PAB.Utils
{
public class MailUtil
{
private MailUtil() { }
public static void SendMail(string smtpServer, string fromAddress, string
toAddress, string subject, string body)
{
System.Net.Mail.SmtpClient test = new System.Net.Mail.SmtpClient();
test.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
test.UseDefaultCredentials = true;
test.Host = smtpServer;
test.Send(fromAddress,toAddress,subject,body);
}
}
}
--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"perspolis" wrote:
Hi
I'm using System.Net.Mail to send a mail.
It dosen't work properly.it sends but I can't get it in the destination.but
with previous namespace System.Web.Mail I can send mail successfully.
I set all of properties like each other..
I don't know what the problem is ?
thanks in advance