Email client parametering via COM is not working


#1

Hi,

I have to create .pdf files and sending it via default Email client in Visual Foxpro.
(Windows 7 + Live mail + PDFCreator 2.4.1 Build 13)

oPDQ=CREATEOBJECT(“PDFCreator.JobQueue”)
oPDQ.Initialize()

set printer to name (‘PDFCreator_mail’)
report form ko noconsole to printer && sending printing job to PDF

if oPDQ.WaitForJob(10)
job=oPDQ.NextJob
job.SetProfileSetting(“OpenViewer”,“False”) && it is the last point, that is good
job.SetProfileSetting(“EmailClient.Enabled”, “True”) && here i get an error message.
job.SetProfileSetting(‘EmailClient.Subject’,‘Test Subject’)
job.SetProfileSetting(‘EmailClient.Message’,‘Test Body’)
job.SetProfileSetting(‘EmailClient.Recipients’,‘mak22@gmail.com’)

erase (‘H:\Masol\Testpdf.pdf’)
job.convertTo(‘H:\Masol\Testpdf.pdf’)

if !job.IsFinished .or. !job.IsSuccessful
=messagebox(‘Error’)
endif
else
?‘Error:’+str(oPDQ.Count)
endif
oPDQ.ReleaseCom

Everything is working good until that line:
job.SetProfileSetting(“EmailClient.Enabled”, “True”)

Error message:
OLE IDispatch exception code 0 from
PDFCreator.ComImplementation: The property
‘EmailClient.Enabled’ does not exist.

If I skip the 4 email parameter rows, the rest is running smoothly. (But no email is sending)

Please help me,
Best regards, Andras


#2

Meanwhile I solved the problem.
Now it works fine.
The documentation was wrong.


#3

Hey there,

could you tell me what you did? I’m having the same problem…
Thanks


#4

Sorry about that; could you please let us know the error so we can correct it for future updates?


#5

The correct syntax is:

job.SetProfileSetting(“EmailClientSettings.Enabled”, “True”)
job.SetProfileSetting(“EmailClientSettings.AddSignature”, “False”)
job.SetProfileSetting(‘EmailClientSettings.Subject’,‘Test Subject’)
job.SetProfileSetting(‘EmailClientSettings.Content’,Test Body)
job.SetProfileSetting(‘EmailClientSettings.Recipients’,‘mk72@gmail.com’)