I have been successfully using CDO to send emails from within an app using a
Gmail account I set up for the purpose. I decided to use Blat instead after
all the comments here about how good it is :-). If I use my personal email
account parameters it works fine but as soon as I change it to the Gmail
parameters (which work with CDO) I get an error message 'File name (message
text) not given" OR "Bad argument given'
The code section setting out the parameters is:
*&* Create an object to use to hold the email parameters
loParam = CREATEOBJECT('custom')
*&* Add and populate the properties
WITH loParam
*&* From Address
.ADDPROPERTY('cFromAddress', '[email protected]')
*&* To Address - separate addresses with commas
.ADDPROPERTY('cTo', '[email protected]')
*&* CC Address - separate addresses with commas
.ADDPROPERTY('cCC', '')
*&* BCC Address - separate addresses with commas
.ADDPROPERTY('cBCC', '[email protected]')
*&* Subject
.ADDPROPERTY('cSubject', 'Test')
*&* Body
.ADDPROPERTY('cBody', 'test')
*&* HTML format
.AddProperty('lHTMLFormat', .F.) && set to plain text,
change to .T. to send HTML
*&* SMTP Server
.ADDPROPERTY('cSMTPServer', "smtp.gmail.com")
*&* Port
.AddProperty('nPort', 465)
*&* User name
.AddProperty('cUserName', '[email protected]') && SMTP
user name
*&* Password
.AddProperty('cPassword', 'mypassword') && SMTP password
*&* Attachments
*!* .ADDPROPERTY('aAttachment[1]', '')
*!* .aAttachment[1] = ThisForm.NewsLoc
*&* Priority
.AddProperty('nPriority', 0) && 1 = high, 0 =low
ENDWITH
I can send and receive from the Gmail account normally.
Any help gratefully received!
TIA
John Weller
01380 723235
07976 393631
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.