G
Glenn
I am having problems Authenticating to my SMTP Server. The code I am using is
as follows
public void SendMail(string fromAddress, string toAddress, string subject,
string body, string Password)
{
try
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(fromAddress);
msg.To.Add(new MailAddress(toAddress));
msg.Subject = subject;
msg.Body = body;
msg.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "myemailserver.net";
smtp.Port = 25;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new
System.Net.NetworkCredential("testaccount", "design");
smtp.EnableSsl = false;
smtp.Send(msg);
//return true;
}
catch (Exception ex)
{
///Log.Write(ex)
//return false;
}
}
when I view the log on the smtp server I get
[12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT
[12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com AAMail
SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39.
[12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt
[12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH LOGIN
[12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN
aWRzbWVkaWEubmV0XGRlc2lnbg==
[12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6
[12-09 11:08:23] 98.172.47.252: SMTP_client: design
[12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6
[12-09 11:08:23] 98.172.47.252: SMTP_client:
[12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed
I am far from an expert on SMTP but it appears that it is only sending over
the paasword and not the login information. but if I new that for sure I
woulnt be here asking. any help would be apprecitated
I am using VS2008, .net 2.0/3.5, silverlight 2
thanks
as follows
public void SendMail(string fromAddress, string toAddress, string subject,
string body, string Password)
{
try
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(fromAddress);
msg.To.Add(new MailAddress(toAddress));
msg.Subject = subject;
msg.Body = body;
msg.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "myemailserver.net";
smtp.Port = 25;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new
System.Net.NetworkCredential("testaccount", "design");
smtp.EnableSsl = false;
smtp.Send(msg);
//return true;
}
catch (Exception ex)
{
///Log.Write(ex)
//return false;
}
}
when I view the log on the smtp server I get
[12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT
[12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com AAMail
SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39.
[12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt
[12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH LOGIN
[12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN
aWRzbWVkaWEubmV0XGRlc2lnbg==
[12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6
[12-09 11:08:23] 98.172.47.252: SMTP_client: design
[12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6
[12-09 11:08:23] 98.172.47.252: SMTP_client:
[12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed
I am far from an expert on SMTP but it appears that it is only sending over
the paasword and not the login information. but if I new that for sure I
woulnt be here asking. any help would be apprecitated
I am using VS2008, .net 2.0/3.5, silverlight 2
thanks