?
Solved

ASP MAPI mail not sending?

Posted on 2003-02-25
4
Medium Priority
?
423 Views
Last Modified: 2010-07-27
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):

agent_email=Request("agent_email")

body = "blah blah blah"

' Create the CDO session object
Set objSession = CreateObject("MAPI.Session")
bstrProfileInfo = "LOTNWEB1"  + vbLf + "AnonUser"
'Logon
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
Else
     objOneRecip.Name = agent_email
     Set objTwoRecip = objMessage.Recipients.Add
     objTwoRecip.Name = "scotland@blahblahblah.com"
     objTwoRecip.Resolve
     Set objThreeRecip = objMessage.Recipients.Add
     objThreeRecip.Name = "duncan.cumming@alienationdesign.co.uk"
     objThreeRecip.Resolve
         
End If

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
Else
     error = "SENT"
     On Error Goto 0
     ' send the message and log off
     objMessage.Send showDialog=false

     Response.Write "<html><head><title>Send an Email</title></head><body bgcolor=""#FFFFCC""><BR><BR><BR><BR><FONT face=""Tahoma, Verdana, Arial"" size=""2"" color=""#000066""><B><CENTER>Your Email has been sent<BR><BR><BR>     <a HREF=""javascript:window.close()"">Click Here to close this window</a></CENTER></B></FONT></body></html>"

End If

objSession.Logoff

Set objSession = nothing
Set objMessage = nothing
Set objOneRecip = nothing

Set cmdInsEmail = Nothing
rst.close
Conn.Close
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.

0
Comment
Question by:duncancumming
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
markhoy earned 225 total points
ID: 8017033
is the mail being kept in "badmail"?is the smtp service running? can you send email from the server using Outlook?

test your script and then do a search on *.eml on the server running the IIS service. sounds like the smtp smarthost isn't being resolved or the smtp host it points to isn't running.
0
 
LVL 16

Author Comment

by:duncancumming
ID: 8017349
can't find any 'badmail' folder.  

The Microsoft Message Transfer Agent service wasn't started; starting it generated an error, something which relates back to a problem the client had last year which was supposedly fixed by a 3rd party.  

Sending mail from Outlook... not working.  Email remains in outbox, and doesn't get sent.  Send/Receive briefly pops up the dialog box, but doesn't appear to actually send it.  I assume because the MTA isn't running.

*.eml search returns > 2000 items, dating back from 2000 - 2002, but nothing recently.  This was all from earlier problems they'd had with their mailserver.  

Apparently they *are* receiving some emails sent through the site, depending on the form used.  I'll compare code and spot the differences.  Thanks for the pointers.
0
 
LVL 16

Author Comment

by:duncancumming
ID: 8017645
it seems the mail that is working uses CDONTS; the mail that's not working uses MAPI.  Would it be a good short-term solution to change all the MAPI mail to CDONTS mail?  I don't really know what the differences are between them, or any advantages/disadvantages of either method.
0
 

Expert Comment

by:CleanupPing
ID: 9576872
duncancumming:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question