Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 4 Jahren, 7 Monaten
Letzter Beitrag:
vor 4 Jahren, 7 Monaten
Beteiligte Autoren:
Viggo Poulsen, Fabrice Harari, Piet van Zanten, Ericus

wb18 preset email address to PDF report ?

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

Antworten:

Hi
No answers ? Does this meen it cannot be done ?

Best regards
Viggo Poulsen

von Viggo Poulsen - am 10.09.2013 12:38
Hi

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
Hi Ericus

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
Hi Viggo

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
Hi Fabrice

That sounds great. Flexible as most else in wx18 :-)

Best regards
Viggo Poulsen

von Viggo Poulsen - am 11.09.2013 14:06
Hi Fabrice,

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
Hi Piet

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
- As the thread developped, I lost track of the original information

hmm, me too.

Best regards
Viggo Poulsen

von Viggo Poulsen - am 11.09.2013 17:31
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.