P
Paul Mason
Hi folks,
Can someone let me know if there is a more appropriate area for this
question.
The following code used to work when we had our own email server,which has
now been decommissioned. I can't remember how I managed to get hold of the
smtp server name.
Dim objMail As MailMessage
Dim booRet As Boolean
Dim strBody As String
Try
strBody = "Message goes here"
objMail = New MailMessage
objMail.To = Me.Problem.EmailTo
objMail.From = "Helpdesk system"
objMail.Body = strBody
objMail.Subject = "Subject"
objMail.BodyFormat = Web.Mail.MailFormat.Text
SmtpMail.SmtpServer = "my server name goes here"
SmtpMail.Send(objMail)
booRet = True
Catch ex As Exception
strError = "clsJob.SendReportEmail : " & ex.Message
booRet = False
Finally
objMail = Nothing
End Try
When I put in the new server name it pops up with the following error :
clsJob.SendReportEmail : Could not access 'CDO.Message' object.
I managed to dig out a more specific error message :
clsJob.SendReportEmail : System.Web.HttpException: Could not access
'CDO.Message' object. ---> System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020E): The server
rejected the sender address. The server response was: 501 5.5.4 Invalid
Address
The help for the smtpmail object goes on about making sure port 25 is open.
Is this symptomatic of this?
Finally how can I make sure I've got the correct server name?
Thanks in advance
Cheers...P
Can someone let me know if there is a more appropriate area for this
question.
The following code used to work when we had our own email server,which has
now been decommissioned. I can't remember how I managed to get hold of the
smtp server name.
Dim objMail As MailMessage
Dim booRet As Boolean
Dim strBody As String
Try
strBody = "Message goes here"
objMail = New MailMessage
objMail.To = Me.Problem.EmailTo
objMail.From = "Helpdesk system"
objMail.Body = strBody
objMail.Subject = "Subject"
objMail.BodyFormat = Web.Mail.MailFormat.Text
SmtpMail.SmtpServer = "my server name goes here"
SmtpMail.Send(objMail)
booRet = True
Catch ex As Exception
strError = "clsJob.SendReportEmail : " & ex.Message
booRet = False
Finally
objMail = Nothing
End Try
When I put in the new server name it pops up with the following error :
clsJob.SendReportEmail : Could not access 'CDO.Message' object.
I managed to dig out a more specific error message :
clsJob.SendReportEmail : System.Web.HttpException: Could not access
'CDO.Message' object. ---> System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020E): The server
rejected the sender address. The server response was: 501 5.5.4 Invalid
Address
The help for the smtpmail object goes on about making sure port 25 is open.
Is this symptomatic of this?
Finally how can I make sure I've got the correct server name?
Thanks in advance
Cheers...P