PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
WX - Código do Botão GERAR PDF enviar Email
WX - Código do Botão GERAR PDF enviar Email
Started by BOLLER, Dec., 07 2018 11:51 PM - No answer
Connect yourself…
BOLLER
#1
Registered member
3,655 messages
Popularité : +175 (223 votes)
Posted on December, 07 2018 - 11:51 PM
C
ódigo
DO
Botão GERAR PDF enviar
Email
:
d
is Document
=
E
DT_Exemplo_DOC
b
Ok
is boolean
=
DocToPDF
(d,
"C:\testepdfwx.pdf"
)
IF
b
Ok
THEN
Info
(
"PDF gerado com sucesso"
)
IF
Dialog
(
"Deseja enviar email"
, [
"Sim"
,
"Não"
]
,
1
,
2
,
dlgIconQuestion
) =
1
Info
(
"Envia Email"
)
EnviaEmail
(
"C:\TestePDFWx.PDF"
)
END
END
Procedure
EnviaEmail
(
c
ArquivoEnviar
)
gSessionSMTP
is emailSMTPSession
// EMAILCONF
gSessionSMTP
..
ServerAddress
=
"smtp-mail.outlook.com"
gSessionSMTP
..
Name
=
"email@hotmail.com"
gSessionSMTP
..
Password
=
"senha"
gSessionSMTP
..
Port
=
587
gSessionSMTP
..
Option
=
emailOptionSecuredTLS
// MESSAGE
oEmail
is Email
oEmail
..
Sender
=
"Remetente <email@hotmail.com>"
oEmail
..
Recipient
[
1
] =
"destinatario@empresa.com.br"
oEmail
..
Subject
=
"Assunto"
oEmail
..
Message
=
"Message"
oEmail
..
HTML
=
oEmail
..
Message
// ANEXO
IF
fFileExist
(
c
ArquivoEnviar
)
THEN
EmailLoadAttachment
(
oEmail
,
c
ArquivoEnviar
)
END
// Envia Email
IF
EmailStartSession
(
gSessionSMTP
) =
True
THEN
IF
EmailSendMessage
(
gSessionSMTP
,
oEmail
) =
False
THEN
Trace
(
"ERRO: O envio do email falhou"
,
ErrorInfo
(
errMessage
)
)
ELSE
Trace
(
"OK: Email sucessuful send"
)
END
ELSE
Trace
(
"ERRO: Impossivel estabelcer a conexão"
,
ErrorInfo
(
errMessage
)
)
END
by Cassiano
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text