FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
Enviar email com HTML personalizado
Enviar email com HTML personalizado
Débuté par TOM SILVA / RMT SYST, 26 fév. 2016 00:41 - Aucune réponse
Connectez-vous…
TOM SILVA / RMT SYST
#1
Membre enregistré
7 messages
Popularité : +2 (2 votes)
Posté le 26 février 2016 - 00:41
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
,
"senha aqui"
, ...
"smtp server aqui"
,
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
)
//
Corpo = StringBuild(EDT_Nombre+CR+EDT_MAIL+CR+ EDT_TEL...
//
+CR+"Oriegen"+COMBO_ORIGEN+CR+"Destino"+COMBO_DESTINO...
//
+CR+EDT_FECHA+CR+EDT_HORA+CR+"Nro Adultos"+""+COMBO_ALDULTOS...
//
+CR+ "Nro Niños"+""+COMBO_NINOS+CR+EDT_OBSERV,DateToString(DateSys(),maskSystemDate), "admin","12345")
//
//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
Message modifié, 26 février 2016 - 02:43
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte