Witam,
Mam problem z wysyłaniem maila na okreslony adres pocztowy.
Procedura SENDMAIL <ort>wyżuca </ort>mi taki wyjatek:
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, Strin
g response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, Stri
ng from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressColl
ection recipients, String deliveryNotify, SmtpFailedRecipientException& exceptio
n)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at MailSender.SendMail.SENDMAIL() in C:\Documents and Settings\Pawel\Moje dok
umenty\Visual Studio 2005\Projects\MailSender\MailSender\Class1.cs:line 131
at MailSender.SendMail.sendMail() in C:\Documents and Settings\Pawel\Moje dok
umenty\Visual Studio 2005\Projects\MailSender\MailSender\Class1.cs:line 97
at SendingMails.Program.Main(String[] args) in C:\Documents and Settings\Pawe
l\Moje dokumenty\Visual Studio 2005\Projects\SendingMails\SendingMails\Program.c
s:line 23
private void SENDMAIL()
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(this.from);//tutaj jest [email protected]
msg.To.Add(new MailAddress(this.to));// [email protected]
foreach( String recAdres in this.rec_adresses)
msg.To.Add(new MailAddress(recAdres)); //dodatkowi odbiorcy
msg.Subject = this.subject;
msg.Body = this.body;
msg.IsBodyHtml = false;
msg.BodyEncoding = System.Text.Encoding.GetEncoding("iso-8859-2");
foreach(String fpath in this.attatchment_patch)
{
Attachment ma = new Attachment(fpath); //sciezki do zalacznikow
msg.Attachments.Add(ma);
}
SmtpClient client = new SmtpClient();
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.Host = this.SmtpAdress;// tutaj jest smtp.wp.pl
client.Send(msg);
//client.SendAsync(msg, userState); //to też nie działa
}
Z góry dziekuję za pomoc
Paweł