Hello,
If I use the SendMail which uses Outlook, I get the mail and included pdf attachment.
When using the SendSmtpMailEx to avoid Outlook, I get the email but never the pdf attachment.
I also notice that the CC and BCC are ignored and never receive an email.
I am using PDF Converter version 4.5 (GetVersionInformation reports as 4.0)
I am using Visual Foxpro 9 sp2.
I am using the ActiveX.
Any ideas why those 3 things are not working?
SendSmtpMailEx does not send with attachment
Re: SendSmtpMailEx does not send with attachment
Please post the VFP code that you are using to send the file attachment, we will check it and get back to you shortly.
Amyuni Development Team
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
-
- Posts: 6
- Joined: Wed Apr 27 2011
Re: SendSmtpMailEx does not send with attachment
LOCAL CDIntfMajor as Long, CDIntfMinor as Long, PrinterDriverMajor as Long, PrinterDriverMinor as Long
LOCAL lnResult1, lnResult2, lnResult3, llSuccess1, llSuccess2, llSuccess3
STORE 0 TO CDIntfMajor, CDIntfMinor, PrinterDriverMajor, PrinterDriverMinor
* normal program stuff
oCdi = CreateObject("CDIntfEx.CDIntfEx.4.5")
lcName = "Our Company PDF Export"
* Initialize printer
TRY
lnResult1 = oCdi.DriverInit(lcName)
oCdi.GetVersionInformation(@CDIntfMajor, @CDIntfMinor, @PrinterDriverMajor, @PrinterDriverMinor)
CATCH TO oErr
lcResult = oCdi.GetLastErrorMsg
Messagebox(lcResult)
FINALLY
RELEASE oErr
ENDTRY
IF lnResult1 != 0
* quit
lcResult = oCdi.GetLastErrorMsg
Messagebox("PDF Printer is not installed! ",48,"Error")
ELSE
oCdi.DefaultDirectory= 'C:\temp\'
oCdi.DefaultFileName = 'c:\temp\mytest3.pdf'
SET PRINTER TO NAME "&lcName"
oCdi.Resolution = 600 && set output resolution to 600 DPI
llSuccess1 = oCdi.SetDefaultConfig
oCdi.FileNameOptionsEx = NoPrompt + ;
UseFileName + ;
EmbedFonts + ;
MultilingualSupport + ;
EncryptDocument +;
SendByEmail && All declared correctly
oCdi.OwnerPassword = 'owner' && set owner password
oCdi.UserPassword = 'user' && set user password
oCdi.Permissions = -64 + 4 && set permissions
oCdi.EmailOptions = 4 && set mail options to smtp
llSuccess2 = oCdi.SetDefaultPrinter
lnResult2 = oCdi.EnablePrinter(lcRegName, lcRegNumber)
report form report1 noconsole to printer nodialog
set printer to default
lnResult3 = oCdi.SendSmtpMailEx("mail.mycompany.com", 26, "user@mycompany.com", "mypassword", ;
"sales@mycompany.com",;
"teammate@secondcompany.com; teammate2@mycompany.com",;
"boss@mycompany.com ",;
"tester@thirdcompany.com",;
"Testing the SendSmtpMailEx with attachments",;
"I hoped a PDF would have been attached",;
"c:\temp\mytest3.pdf;test.pdf")
llSuccess3 = oCdi.RestoreDefaultPrinter
oCdi.FileNameOptionsEx = 0
oCdi.DriverEnd
ENDIF
teammate will get email from sales but no attachment
teammate2 and other email addresses go into cyberspace black hole.
If i use same basic code with sendmail, it works.
LOCAL lnResult1, lnResult2, lnResult3, llSuccess1, llSuccess2, llSuccess3
STORE 0 TO CDIntfMajor, CDIntfMinor, PrinterDriverMajor, PrinterDriverMinor
* normal program stuff
oCdi = CreateObject("CDIntfEx.CDIntfEx.4.5")
lcName = "Our Company PDF Export"
* Initialize printer
TRY
lnResult1 = oCdi.DriverInit(lcName)
oCdi.GetVersionInformation(@CDIntfMajor, @CDIntfMinor, @PrinterDriverMajor, @PrinterDriverMinor)
CATCH TO oErr
lcResult = oCdi.GetLastErrorMsg
Messagebox(lcResult)
FINALLY
RELEASE oErr
ENDTRY
IF lnResult1 != 0
* quit
lcResult = oCdi.GetLastErrorMsg
Messagebox("PDF Printer is not installed! ",48,"Error")
ELSE
oCdi.DefaultDirectory= 'C:\temp\'
oCdi.DefaultFileName = 'c:\temp\mytest3.pdf'
SET PRINTER TO NAME "&lcName"
oCdi.Resolution = 600 && set output resolution to 600 DPI
llSuccess1 = oCdi.SetDefaultConfig
oCdi.FileNameOptionsEx = NoPrompt + ;
UseFileName + ;
EmbedFonts + ;
MultilingualSupport + ;
EncryptDocument +;
SendByEmail && All declared correctly
oCdi.OwnerPassword = 'owner' && set owner password
oCdi.UserPassword = 'user' && set user password
oCdi.Permissions = -64 + 4 && set permissions
oCdi.EmailOptions = 4 && set mail options to smtp
llSuccess2 = oCdi.SetDefaultPrinter
lnResult2 = oCdi.EnablePrinter(lcRegName, lcRegNumber)
report form report1 noconsole to printer nodialog
set printer to default
lnResult3 = oCdi.SendSmtpMailEx("mail.mycompany.com", 26, "user@mycompany.com", "mypassword", ;
"sales@mycompany.com",;
"teammate@secondcompany.com; teammate2@mycompany.com",;
"boss@mycompany.com ",;
"tester@thirdcompany.com",;
"Testing the SendSmtpMailEx with attachments",;
"I hoped a PDF would have been attached",;
"c:\temp\mytest3.pdf;test.pdf")
llSuccess3 = oCdi.RestoreDefaultPrinter
oCdi.FileNameOptionsEx = 0
oCdi.DriverEnd
ENDIF
teammate will get email from sales but no attachment
teammate2 and other email addresses go into cyberspace black hole.
If i use same basic code with sendmail, it works.
Re: SendSmtpMailEx does not send with attachment
There is an extra space character here:
"teammate@secondcompany.com; teammate2@mycompany.com"
This unfortunately creates an issue when parsing the email addresses and attachments. We are looking at fixing this issue, in the meantime you can remove the space character in order to send out the attachments.
"teammate@secondcompany.com; teammate2@mycompany.com"
This unfortunately creates an issue when parsing the email addresses and attachments. We are looking at fixing this issue, in the meantime you can remove the space character in order to send out the attachments.
Amyuni Development Team
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com