Mailjet and Visual Basic Code Sample


' 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 = ""
  Dim To As String = ""
  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 ("", 465)
  client.EnableSsl = True
  client.Credentials = New NetworkCredential (APIKey, SecretKey)
  client.Send (msg)
End Sub