Access, CDO and Exchange

loybob
loybob used Ask the Experts™
on
I'm setting up a button on an Access form in my Access application to send an email.  I have this code working perfectly on my pc, using my Outlook 2007 and pop3 email from Verizon - it attaches the report and sends the email.

=============================

 Set objCDO = CreateObject("CDO.Message")

objCDO.From = fromEmail
objCDO.To = DsStatusData![Email]
objCDO.Subject = "Status Report from Smith Consulting"
objCDO.TextBody = "Please see the attached Status Report - It can be opened with Microsoft Word.  Please reply to this email and attach the completed form."
objCDO.AddAttachment ("F:\TABS\Status Reports\StatusReportEmail.rtf")

With objCDO.Configuration
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email@verizon.net"
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.verizonemail.net"

.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusess1") = False
.Fields.Update
End With

objCDO.Send

Set objCDO = Nothing

==============================

My user is using Exchange 2010, and on her system I'm using:

.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email@smithllc.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "sbs.smithllc.local"

When the code running on her system gets to

objCDO.send

I get  "Execution of this Application has stopped due to a run-time error, the application can't contiune and will be shut down."

Is there something that needs to be configured in her Exchange server?  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you have POP enabled on your exchange server, grant the user access to POP3 and configure it the same as the verizon account (you might need to substitute port 25 for 587 for SMTP. by default exchange uses both ports but internal designation is 587.
You don't mention your version.  EMail can be difficult in earlier versions, but if you are on AC2010, there is a macro that uses the current users working MAPI-compliant email service.

I have attached the steps in a one line Macro that I use.
EMail-Macro.png

Author

Commented:
spiderwik2007:  Let me check that and see if it will work.

DoDahD:  The application uses Access 2003 runtime. I'll check, but  I don't think that would be compatible.
You are correct.   The macro is not available in 2003.  Your version issue was not clear.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial