|
| Inicio → WINDEV 2024 → Email.NbAttach + Email.Attach specified but no appearance in email ? |
| Email.NbAttach + Email.Attach specified but no appearance in email ? |
| Iniciado por software, 24,ago. 2016 17:26 - 1 respuesta |
| |
| | | |
|
| |
Miembro registrado 27 mensajes |
|
| Publicado el 24,agosto 2016 - 17:26 |
Hi,
I use the EmailSendMessage instruction for quite a time with no problem. I use also Email.NbAttach + Email.Attach for my Attach file(s).
When i debug the project within Windev20 my application is working fine , its created correct emails with attach files !
After creating the executable the application is creating the emails but without attachment files ????? I had no errors .
What could be wrong ?
Hope someone can help me quick cause i have a production isuue to sove.
Thanks,
EricProcedure Email_Klant_Copy_Werkbon(p_datum_planning, p_technieker, p_bestand, p_taal_klant, l_error)
sHTMLFile is string sDir is string SWITCH p_taal_klant CASE "NL" sHTMLFile = g_path_WB_DOC + "werkbon_email_klant.htm" CASE "FR" sHTMLFile = g_path_WB_DOC + "werkbon_email_klant_FR.htm" OTHER CASE sHTMLFile = g_path_WB_DOC + "werkbon_email_klant.htm" END
EmailSetTimeOut(g_EmailSetTimeOut) IF EmailStartSMTPSession( g_Email_Sender, g_PasswordUserSMTP , g_SessionSMTP, g_PortSMTP, False ,emailOptionSecuredTLS) = True THEN EmailReset() sDir = fExtractPath(sHTMLFile,fDirectory) EmailImportHTML(fLoadText(sHTMLFile),sDir)
SWITCH p_taal_klant CASE "NL" Email.HTML = Replace(Email.HTML,"[%Technieker%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Datum%]",DateToString(p_datum_planning)) CASE "FR" Email.HTML = Replace(Email.HTML,"[%Technicien%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Date%]",DateToString(p_datum_planning)) OTHER CASE Email.HTML = Replace(Email.HTML,"[%Technieker%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Datum%]",DateToString(p_datum_planning)) END Email.Sender = g_Email_Sender Email.Recipient[1] = g_Email_Recip_Klant Email.NbRecipient = 1 Email.Bcc[1] = g_Email_Sender Email.NbBcc = 1 IF g_Email_Recip_Forward <> "" THEN Email.Bcc[2] = g_Email_Recip_Forward Email.NbBcc = 2 END Email.NbAttach = 1 Email.Attach = g_Path_server + p_bestand SWITCH p_taal_klant CASE "NL" Email.Subject = g_Omgeving+"/(Klant) Kopie " + Middle(p_bestand,Position(p_bestand ,"\",1)+1) CASE "FR" Email.Subject = g_Omgeving+"/(Client) Copie " + Middle(p_bestand,Position(p_bestand ,"\",1)+1) OTHER CASE Email.Subject = g_Omgeving+"/(Klant) Kopie " + Middle(p_bestand,Position(p_bestand ,"\",1)+1) END
IF EmailSendMessage(g_Email_Sender) = False THEN Error() l_error = 1 ELSE IF EmailBuildSource() = True THEN savefolder is string = "" savefoldertext is string HReadSeekFirst(TYPEDOC,Type_doc,"COMMXX") IF HFound(TYPEDOC) = True THEN IF TYPEDOC.Map_doc <> "" THEN savefolder = g_Path_PDF + TYPEDOC.Map_doc + "\" ELSE savefolder = g_Path_PDF END FileID is int = fMakeDir(savefolder) IF FileID = -1 THEN Error(ErrorInfo()) l_error = 1 GOTO END_BUTTON END savefoldertext = savefolder + Replace(ExtractString(p_bestand,1,"\",FromEnd),".PDF",".eml") fSaveText(savefoldertext,Email.Source) ELSE savefolder = g_Path_PDF FileID is int = fMakeDir(savefolder) IF FileID = -1 THEN Error(ErrorInfo()) l_error = 1 GOTO END_BUTTON END savefoldertext = savefolder + Replace(ExtractString(p_bestand,1,"\",FromEnd),".PDF",".eml") fSaveText(savefoldertext,Email.Source) END ELSE l_error = 1 END END END_BUTTON: EmailCloseSession(g_Email_Sender)
ELSE Error("Unable to establish connection", ErrorInfo(), ... "In case of time-out, check the parameters of the "+ ... """Firewall"" on the port used (587)") l_error = 1 END |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 27 mensajes |
|
| Publicado el 25,agosto 2016 - 08:44 |
Corrections on the above code : (code was bad copied), sorry
SWITCH p_taal_klant CASE "NL" Email.HTML = Replace(Email.HTML,"[%Technieker%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Datum%]",DateToString(p_datum_planning)) CASE "FR" Email.HTML = Replace(Email.HTML,"[%Technicien%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Date%]",DateToString(p_datum_planning)) OTHER CASE Email.HTML = Replace(Email.HTML,"[%Technieker%]",p_technieker) Email.HTML = Replace(Email.HTML,"[%Datum%]",DateToString(p_datum_planning)) END
It seems to be that the code is not good displayed here !!Mensaje modificado, 25,agosto 2016 - 08:46 |
| |
| |
| | | |
|
| | | | |
| | |
|