ASP MAPI mail not sending?
Posted on 2003-02-25
Several forms that automatically send email to various recipients, none of them appear to be working recently (about 3 weeks), although they've worked fine previously, and no changes have been made to the code.
The pages give the impression the email is being sent, no error message is generated, but the recipients never receive any email. Can't find any undelivered emails on the server (could be I'm not looking in the correct place), or any clues as to what's wrong.
Some code that's being used (slightly edited):
body = "blah blah blah"
' Create the CDO session object
Set objSession = CreateObject("MAPI.Session")
bstrProfileInfo = "LOTNWEB1" + vbLf + "AnonUser"
objSession.Logon , , , true, , true, bstrProfileInfo
' create a message and fill in its properties
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Property Enquiry from a Tenant"
objMessage.Text = body
' create the recipient
Set objOneRecip = objMessage.Recipients.Add
If agent_email = "" Then
objOneRecip.Name = friends_email
objOneRecip.Name = agent_email
Set objTwoRecip = objMessage.Recipients.Add
objTwoRecip.Name = "email@example.com"
Set objThreeRecip = objMessage.Recipients.Add
objThreeRecip.Name = "firstname.lastname@example.org"
On Error Resume Next
objOneRecip.Resolve ' get MAPI to determine complete e-mail address
If Err.Number <> 0 Then
error = "FAILED"
On Error Goto 0
error = "SENT"
On Error Goto 0
' send the message and log off
Set objSession = nothing
Set objMessage = nothing
Set objOneRecip = nothing
Set cmdInsEmail = Nothing
set rst = nothing
Set Conn = Nothing
The message 'Your Email has been sent' get's displayed, so users assume their email has in fact been sent. None of the recipients get any email however. I think the code is correct (it used to work), and it's more likely something like a service on the server not being started? any ideas please.