M
mmassari
Hi,
I need to send a mail message from a web service.
If i execute the code from a Windows Form Application the message is
sended correctly but if i execute the same code from a web service an
exception is throwed "Could not access 'CDO.Message' object".
That's the code:
Public Sub Send()
Try
Dim i As String
Dim m As New MailMessage
m.BodyEncoding = System.Text.Encoding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.Normal
m.Subject = "Hello"
m.To = "(e-mail address removed)"
m.From = "(e-mail address removed)"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.com"
ss.Send(m)
Catch ex As Exception
Debug.Write("Error: " & ex.Message)
End Try
End Sub
Why?
I need special permission?
I miss something?
Thanks
Michele
I need to send a mail message from a web service.
If i execute the code from a Windows Form Application the message is
sended correctly but if i execute the same code from a web service an
exception is throwed "Could not access 'CDO.Message' object".
That's the code:
Public Sub Send()
Try
Dim i As String
Dim m As New MailMessage
m.BodyEncoding = System.Text.Encoding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.Normal
m.Subject = "Hello"
m.To = "(e-mail address removed)"
m.From = "(e-mail address removed)"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.com"
ss.Send(m)
Catch ex As Exception
Debug.Write("Error: " & ex.Message)
End Try
End Sub
Why?
I need special permission?
I miss something?
Thanks
Michele