Scripts d'exemple avec Mailjet et Visual Basic.

Description

 
 
'
' Class example to send an email by Mailjet using SSL and port 465.
'
' 

Imports System.Net
Imports System.Net.Mail
 
Shared Sub Main (ByVal args As String ())
  Dim APIKey As String = "your Mailjet API Key"
  Dim SecretKey As String = "your Mailjet Secret Key"
  Dim From As String = "you@example.com"
  Dim To As String = "recipient@example.com"
 
  Dim msg As New MailMessage ()
 
  msg.From = New MailAddress (From)
 
  msg.To.Add (New MailAddress (To))
 
  msg.Subject = "Your mail from Mailjet"
  msg.Body = "Your mail from Mailjet, sent by VB.NET."
 
  Dim client As New SmtpClient ("in.mailjet.com", 465)
 
  client.EnableSsl = True
  client.Credentials = New NetworkCredential (APIKey, SecretKey)
 
  client.Send (msg)
End Sub