M
m_evergreen
Errors:
An unhandled exception of type 'System.Web.HttpException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.
innerexception is "Exception has been thrown by the target of an
invocation."
innerexception.innerexception is "The specified protocol is unknown."
I experimented, removing the attachment references and the error goes
away, the email is sent, and recieved. My code for sending the mail
with attachment looks like this:
Dim attachment As New System.web.mail.MailAttachment(filename)
Dim Message As New System.Web.Mail.MailMessage
Message.To = " <[email protected]>"
Message.From = "Order System <[email protected]>"
Message.Body = "Attachment: text file"
Message.Subject = "Your Request"
Message.Attachments.Add(attachment)
System.Web.Mail.SmtpMail.SmtpServer = "mail.company.local"
System.Web.Mail.SmtpMail.Send(Message)
I'm beginning to suspect that the problem may stem from this actually
being a windows application instead of a web application. I imported
System.Web references which includes System.Web.Mail of course. Is
there something else I need in references?
Let me know if more code is needed to troubleshoot. Thank you.
An unhandled exception of type 'System.Web.HttpException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.
innerexception is "Exception has been thrown by the target of an
invocation."
innerexception.innerexception is "The specified protocol is unknown."
I experimented, removing the attachment references and the error goes
away, the email is sent, and recieved. My code for sending the mail
with attachment looks like this:
Dim attachment As New System.web.mail.MailAttachment(filename)
Dim Message As New System.Web.Mail.MailMessage
Message.To = " <[email protected]>"
Message.From = "Order System <[email protected]>"
Message.Body = "Attachment: text file"
Message.Subject = "Your Request"
Message.Attachments.Add(attachment)
System.Web.Mail.SmtpMail.SmtpServer = "mail.company.local"
System.Web.Mail.SmtpMail.Send(Message)
I'm beginning to suspect that the problem may stem from this actually
being a windows application instead of a web application. I imported
System.Web references which includes System.Web.Mail of course. Is
there something else I need in references?
Let me know if more code is needed to troubleshoot. Thank you.