Hi,
I need to send a mail message from a web service.
If i execute the code from 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.Enc oding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.No rmal
m.Subject = "Hello"
m.To = "user1@company. com"
m.From = "user2@company. com"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.c om"
ss.Send(m)
Catch ex As Exception
Debug.Write("Er ror: " & ex.Message)
End Try
End Sub
Why? I need special permission? I miss something?
Thanks
I need to send a mail message from a web service.
If i execute the code from 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.Enc oding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.No rmal
m.Subject = "Hello"
m.To = "user1@company. com"
m.From = "user2@company. com"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.c om"
ss.Send(m)
Catch ex As Exception
Debug.Write("Er ror: " & ex.Message)
End Try
End Sub
Why? I need special permission? I miss something?
Thanks
Comment