Startbeitrag von Viggo Poulsen am 03.09.2013 07:35
Hi there
I am working on a program where I use this to show and print an invoice:
iDestination(iPDF, sFile)
iPrintReport(RPT_Faktura1)
FileDisplay(sFile, "application/pdf")
This works fine. I get a preview of the invoice, and from here I can start my email client and automatically attach the pdf to a new mail.
In my customer database I have the customers email address. It would be a good thing if I somehow could send this information automatically to the new mail.
In WD18 you have iParameterExport to control this but I cannot find anything similar in WB18
Best regards
Viggo Poulsen
I am working on a program where I use this to show and print an invoice:
iDestination(iPDF, sFile)
iPrintReport(RPT_Faktura1)
FileDisplay(sFile, "application/pdf")
This works fine. I get a preview of the invoice, and from here I can start my email client and automatically attach the pdf to a new mail.
In my customer database I have the customers email address. It would be a good thing if I somehow could send this information automatically to the new mail.
In WD18 you have iParameterExport to control this but I cannot find anything similar in WB18
Best regards
Viggo Poulsen
Antworten:
No answers ? Does this meen it cannot be done ?
Best regards
Viggo Poulsen
von Viggo Poulsen - am 10.09.2013 12:38
You have already created the pdf file so all that is left to do is to email that pdf file.
File = Point to your .pdf file
EmailSetTimeOut(10)
IF EmailStartSession(MySession)=True THEN
EmailReset(MyMessage)
MyAttach..Name=File
MyAttach..Content=fLoadText(File)
MyAttach..ContentType="application/pdf"
MyAttach..ContentDescription = "Invoice"
END
MyMessage..Sender = "youremail@domain.com"
MyMessage..Subject = "Invoice No 1234"
IF COMPANY.EMailAddress"" THEN
MyMessage..SenderAddress = COMPANY.EMailAddress
Add(MyMessage..Cc,COMPANY.EMailAddress)
END
MyMessage..DispositionNotification
Add(MyMessage..Recipient,STC_EMail)
Add(MyMessage..Attach,MyAttach)
MailMessage = "Your message in the e-mail"
MyMessage..Message = MailMessage
// Send the message
IF EmailSendMessage(MySession,MyMessage)=False THEN
Error(ErrorInfo())
END
// Close the session
EmailCloseSession(MySession..Name)
ELSE
Error("Unable to start the SMTP session.", ErrorInfo(), ...
"In case of a time-out, check the parameters of the ""Firewall"" on the port used ("+...
MySession..Port+")")
END
I have pre-declared the following:
MailMessage is string
MySession is EmailSMTPSession
MySession..ServerAddress = "smtp.whatever.com"
MySession..Option = emailOptionDefault
MySession..Port=25
MySession..Name = "21281017@domain.com"
MySession..Password = "654321"
MyMessage is Email
MyAttach is EmailAttach
I hope this is what you wanted.
Ericus Steyn
von Ericus - am 10.09.2013 13:46
Thank you for your suggestion. I'll try to go in that direction.
Best regards
Viggo Poulsen
von Viggo Poulsen - am 11.09.2013 09:23
to complete the previous answer, and if you want to keep the send PDF via email button into your preview window, remember that you can modify this window. Once you apply your style to the window, it is included in your project (without any code)...
At this point you can hide the original send via email button, and create your own with your own code
Best regards
von Fabrice Harari - am 11.09.2013 12:28
That sounds great. Flexible as most else in wx18 :-)
Best regards
Viggo Poulsen
von Viggo Poulsen - am 11.09.2013 14:06
Viggo was referring to Webdev, unless I'm missing something there's no preview in Webdev.
Regards,
Piet
von Piet van Zanten - am 11.09.2013 14:47
you are pefectly right ! Thank you for catching that one... As the thread developped, I lost track of the original information :-(
best regards
von Fabrice Harari - am 11.09.2013 16:23
hmm, me too.
Best regards
Viggo Poulsen
von Viggo Poulsen - am 11.09.2013 17:31