Je cherche à envoyer des messages email en html avec formulaire.
Après plusieurs recherches j'ai trouvé ceci de falsam
https://www.purebasic.fr/french/viewtop ... ml#p157407
Cela date de 2010, et le soucis est que je ne voie pas comment renseigné le login et psw pour le smtp.
J'ai essayé avec les commandes classiques et comme ceci mais le mail reçu est vide
EDIT:
Mauvais fichier html, mais apparaît dans les pièces jointes, ce qui ne me convient pas
J'ai masqué les adresse, login et psw évidement
Code : Tout sélectionner
If InitNetwork()
If CreateMail(0,"FROM","Teste html")
SetMailAttribute(0, #PB_Mail_Custom, "Content-Disposition: inline")
AddMailAttachment(0,"text/html", "index.html","text/html")
SetMailBody(0,"")
AddMailRecipient(0,"TO",#PB_Mail_To)
Result = SendMail(0,"pro.eu.turbo-smtp.com",465,#PB_Mail_UseSSL,"LOGIN","PSW")
Repeat
Progress = MailProgress(0)
Delay(300)
Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
If Progress = #PB_Mail_Finished
Debug "success"
Else
Debug "failure"
EndIf
EndIf
EndIf
Code : Tout sélectionner
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table bgcolor="#404040" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<div>
<table bgcolor="#404040" align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="30" style="font-size:30px; line-height: 30px"> </td>
</tr>
</tbody>
<tbody>
<tr>
<td>
<a href="https://www.casimages.com">
<img src="https://nsa40.casimages.com/img/2019/07/26/190726085109986582.png" width="224" border="0" alt="Logo U.D.F.">
</a>
</td>
<td>
<table bgcolor="#404040" align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" style="text-align: center; font-size: 30px; color: #FFF; line-height: 40px">
Union des démonstrateurs francophones
</td>
</tr>
</tbody>
<tbody>
<tr>
<td align="center" style="text-align: center; font-size: 20px; color: #FFF; line-height: 40px">
Rue du Tram , 5     4300 Waremme
</td>
</tr>
</tbody>
<tbody>
<tr>
<td align="center" style="text-align: center; font-size: 15px; color: #FFF; line-height: 100px">
Email : @gmail.com     Tél :
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</tr>
</tbody>
</table>
</body>
</html>