W
Wojciech Kowaluk
i want send e-mail usimg smtp server. i wrote this code:
Dim wiadomosc As Web.Mail.MailMessage = New Web.Mail.MailMessage
Dim config As Web.Mail.MailAttachment = New _
Web.Mail.MailAttachment(sciezka)
wiadomosc.Attachments.Add(config)
wiadomosc.From = "(e-mail address removed)"
wiadomosc.To = "(e-mail address removed)"
wiadomosc.Subject = "..."
wiadomosc.Body = "..."
wiadomosc.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "smtp.o2.pl"
Try
System.Web.Mail.SmtpMail.Send(wiadomosc)
Catch ex As Exception
MsgBox(ex.Message)
End Try
and i get error:
System.Web.HttpException in system.web.dll (Couldnt acces CDO.Message).
what is the problem with this? what i'm doing wrong? pls help.
Regards,
Wojtek
Dim wiadomosc As Web.Mail.MailMessage = New Web.Mail.MailMessage
Dim config As Web.Mail.MailAttachment = New _
Web.Mail.MailAttachment(sciezka)
wiadomosc.Attachments.Add(config)
wiadomosc.From = "(e-mail address removed)"
wiadomosc.To = "(e-mail address removed)"
wiadomosc.Subject = "..."
wiadomosc.Body = "..."
wiadomosc.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "smtp.o2.pl"
Try
System.Web.Mail.SmtpMail.Send(wiadomosc)
Catch ex As Exception
MsgBox(ex.Message)
End Try
and i get error:
System.Web.HttpException in system.web.dll (Couldnt acces CDO.Message).
what is the problem with this? what i'm doing wrong? pls help.
Regards,
Wojtek