<%@ Page aspcompat=true language="VB"%>
<%
On error resume next
Dim mySmartMail as New Object
'Création de l'objet
mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")
'Serveur mail
mySmartMail.Server = "127.0.0.1"
'Expéditeur
mySmartMail.SenderName = "Nom_expéditeur"
mySmartMail.SenderAddress = "expediteur@platine.com"
'Destinataires
mySmartMail.Recipients.Add ("support@platine.com", "Julien")
mySmartMail.Recipients.Add ("destinataire2@platine.com", "Nom_Destinataire2")
'Message
mySmartMail.Subject = "Test aspSmartMail"
mySmartMail.Body = "Ceci est un test du composant aspSmartMail."
'Pièce jointe
'mySmartMail.Attachments.Add Server.MapPath("\sample.txt"),, false
'Envoi du message
mySmartMail.SendMail
'Gestion des erreurs
If err.number <> 0 Then
response.write("Erreur n° " & err.number - vbobjecterror & " = " & err.description & "<br>")
Else
Response.Write ("Message envoyé avec aspSmartMail <br>")
Response.Write (mySmartMail.Attachments.Item(1).FilePathName)
End If
'Suppression de l'objet aspSmartMail
mySmartMail = Nothing
%>
|
| Retour |
|
|