Hi there,
I have the following code:
Private Function SendEmail(ByVal EMailMsg As Mail.MailMessage)
'Local variables.
Dim strMailServer As String
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", <<USER>>)
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", <<PASSWORD>>)
'EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", <<SERVER>>)
'Send the e-mail.
Try
Mail.SmtpMail.SmtpServer = <<SERVER>>
Mail.SmtpMail.Send(EMailMsg)
Catch ex As System.Web.HttpException
'Save the e-mail for sending later.
End Try
End Function
Basically, I want to send the e-mail (this code works fine), but if the e-mail can't be sent for any reason, I want to save it to the hard disk, to be sent at a later date.
How do I do this?
Cheers,
Bryan.
I have the following code:
Private Function SendEmail(ByVal EMailMsg As Mail.MailMessage)
'Local variables.
Dim strMailServer As String
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", <<USER>>)
EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", <<PASSWORD>>)
'EMailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", <<SERVER>>)
'Send the e-mail.
Try
Mail.SmtpMail.SmtpServer = <<SERVER>>
Mail.SmtpMail.Send(EMailMsg)
Catch ex As System.Web.HttpException
'Save the e-mail for sending later.
End Try
End Function
Basically, I want to send the e-mail (this code works fine), but if the e-mail can't be sent for any reason, I want to save it to the hard disk, to be sent at a later date.
How do I do this?
Cheers,
Bryan.