Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO problem

Status
Not open for further replies.

DarrenWard

IS-IT--Management
Feb 15, 2002
217
GB
I have the following code, it appears to be ok, and runs without any errors, but nothing happens. I am running outlook attached to an exchange server, but nothing appears to be created or sent.

oMSG = CREATEOBJECT("cdo.message")
oMSG.To = "me@mydodmain.co.uk"
oMSG.From = "Me"
oMSG.Subject = "Test messages"
oMSG.TextBody = "This is a test"
oAtt = oMSG.AddAttachment("c:\myAtt.txt")
oMSG.send()

Dazz

GuiltyMaggot - The best rock band in the world!
 
DarrenWard

CDO does not create anything on the sender's side. Did the recipient receive anything?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,

No, I sent the email to myself, and nothing has happend.
I would have expected some kind of automation error if there was a problem, but it all runs fine.

GuiltyMaggot - The best rock band in the world!
 
DarrenWard

Being an exchange server (that requires a logon name and password) you may need to use the MAPI session which still uses CDO but has the logon profile name, username a password.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
thanks mike,

I was using the MAPI stuff originally but the CDO code looked a little neater, I will revert back to the original code I had. There is more than one way to skin a cat and I wanted to try em all !

GuiltyMaggot - The best rock band in the world!
 
DarrenWard

FAQ184-1769 was recently updated to examine the different possibilities.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,
I've used your code from FAQ184-1769 to send an automated email from outlook. But when I pass the the logon details for the profile using...

objSession.Logon(<profilename>, <password>)

i am prompted with the logon dialog. the logon name defaults to the value passed but the password remains blank.

(there are multiple profiles set up on the PC that will be running this app and I need it to use a specific profile.)

Do you have any idea why this would happen??

Regards,
Dave
 
DavidLogue

You may want to check you mail settings in the control panel, and see if &quot;Prompt for profile to be used&quot; is not selected.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top