GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 25
→
Enviar email com HTML personalizado
Enviar email com HTML personalizado
Iniciado por TOM SILVA / RMT SYST, fev., 26 2016 12:41 AM - Sem resposta
Conecte-se…
TOM SILVA / RMT SYST
#1
Membro registado
7 mensagems
Popularité : +2 (2 votes)
Publicado em fevereiro, 26 2016 - 12:41 AM
Para fazer o codigo html foi usado o software Kompozer
http://www.kompozer.net/
software e gratuito e ajuda de forma visual a criar o corpo do email.
// Summary: <specify the procedure action>
// Syntax:
//EnviaMail ()
//
// Parameters:
//
None
// Return Value:
//
None
//
// For instance:
// Indicate an example.
//
Procedure
EnviaMail
(
)
UserName is
string
UserName
=
"reservas@empresa.com"
IF
EmailStartSMTPSession
(
UserName
,
"sua senha aqui"
, ...
"ssd.serversecureplusplusalekito.net"
,
465
,
False
,
optionSSL
) =
True
THEN
Destinatario
,
Assunto
,
s
Anexo is
string
Destinatario
=
"Reservas@empresa.com"
Assunto
=
"Nueva Reserva en el sitio web de : ("
+
EDT_
Nombre
+
")"
Corpo is
string
=
[
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Email</title>
</head>
<body>
<span style="font-weight: bold;">Detalles de la Reserva<br>
</span>
<table
style="text-align: left; background-color: rgb(102, 204, 204); width: 360px; height: 284px;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td><span style="font-weight: bold;"> <span
style="color: white;">Nombre :</span> </span></td>
<td><span style="font-weight: bold;"><span
style="color: white;">%1</span> </span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Correo: </span></td>
<td style="color: white;"><span
style="font-weight: bold;">%2</span></td>
</tr>
<tr>
<td><span style="font-weight: bold;"><span
style="color: white;">Teléfono:</span> </span></td>
<td style="color: white;"><span
style="font-weight: bold;"> %3</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Fehca Viaje:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%4</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Hora Viaje :</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%5</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Origem: </span></td>
<td style="color: white;"><span
style="font-weight: bold;"> %6</span></td>
</tr>
<tr>
<td><span style="font-weight: bold;"><span
style="color: white;">Destino: </span> </span></td>
<td style="color: white;"><span
style="font-weight: bold;">%7</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Total Adultos:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%8</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Total de Niños:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">%9</span></td>
</tr>
<tr>
<td style="color: white;"><span
style="font-weight: bold;">Observaciones:</span></td>
<td style="color: white;"><span
style="font-weight: bold;">% 10</span></td>
</tr>
</tbody>
</table>
<span style="font-weight: bold;"><br>
<br>
<br>
</span><span style="font-weight: bold;">Sistema d</span><span
style="font-weight: bold;"></span><span
style="font-weight: bold;">e reservas en linea Transmacuchi</span><br>
<span style="font-weight: bold;"><img
style="width: 139px; height: 129px;" alt="Transmacuchi"
title="Logo"
src="http://www.transmacuchi.com/efactura_web/es/index.awp?WD_ACTION_=IMAGE&M31=2&AWPID=AF8FBAFC4226C77C51ECF7A72A7E5E5C01D08187"></span><span
style="font-weight: bold;"></span><span
style="font-weight: bold;"></span>
</body>
</html>
]
MyArray is
array of
10
string
MyArray
[
1
] =
EDT_
Nombre
MyArray
[
2
] =
EDT_
MAIL
MyArray
[
3
] =
EDT_
TEL
MyArray
[
4
] =
DateToString
(
EDT_
FECHA
,
"DD/MM/YYYY"
)
MyArray
[
5
] =
TimeToString
(
EDT_
HORA
,
"HH:MM:SS"
)
MyArray
[
6
] =
COMBO_
ORIGEN
..
StoredItem
MyArray
[
7
] =
COMBO_
DESTINO
..
StoredItem
MyArray
[
8
] =
COMBO_
ALDULTOS
..
StoredItem
MyArray
[
9
] =
COMBO_
NINOS
..
StoredItem
MyArray
[
10
] =
EDT_
OBSERV
Mensaje is
string
=
StringBuild
(
Corpo
,
MyArray
)
//INICIA A ESTRUTURA DO E-MAIL
MonMessage est un
Email
MonMessage
..
Expediteur
=
"reservas@empresa.com"
Ajoute
(
MonMessage
..
Destinataire
,
Destinatario
)
MonMessage
..
HTML
=
Mensaje
MonMessage
..
AccuséRéception
=
Vrai
MonMessage
..
Sujet
=
Assunto
IF
s
Anexo
<
>
" "
THEN
//EmailLoadAttachment(MonMessage,Anexo)
END
//ENVIA O E-MAIL
IF
EmailSendMessage
(
UserName
,
MonMessage
) =
False
THEN
Error
(
)
ELSE
Info
(
"Mensaje enviada con suceso!"
)
END
EmailCloseSession
(
UserName
)
ELSE
Error
(
"Unable to establish connection"
,
ErrorInfo
(
)
, ...
"In case of time-out, check the parameters of the "
+ ...
""
"Firewall"
" on the port used (587)"
)
END
Agradeço ao Willian pela colaboração...
Mensagem modificada, fevereiro, 26 2016 - 3:27 AM
Denunciar
2
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto