Knowledge Base

Home / Knowledge Base / Using UltraSMTP / Application Developers - Programming Applications to Send Mail Through UltraSMTP


Application developers can program their applications to send outgoing mail from their application through UltraSMTP using the following settings:

Outgoing SMTP Server NamePortSecurity
Please see sample code below for PHP and .NET.

Sample code in PHP (using PHPMailer):
require "class.phpmailer.php";
$mail = new PHPMailer;

$mail->Host = "";	  				     	
$mail->Port = 465;
$mail->SMTPAuth = true;                                  	
$mail->Username = "yourultrasmtpusername";		         	
$mail->Password = "yourultrasmtppassword";               	
$mail->SMTPSecure = 'ssl';                               	

$mail->SetFrom("", "Joe Sender"); 	
$mail->Subject = "this is the subject line";				
$mail->Body = "this is the message body";					

if(!$mail->Send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;

Sample code in .NET (Powershell)
$recipient = ""
$sender = ""
$subject = "this is the subject line" 
$body = "this is the message body" 
$smtpserver = "" 
$smtpusername = "yourultrasmtpusername";		         	
$smtppassword = "yourultrasmtppassword";		         	

$SMTPMessage = New-Object System.Net.Mail.MailMessage($sender, $recipient, $subject, $body)
$SMTPClient = New-Object Net.Mail.SmtpClient($smtpserver,  587) 
$SMTPClient.EnableSsl = $true 
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($smtpusername, $smtppassword); 

Getting Started With UltraSMTP
Configuring Your Mail Client to Send Outgoing Mail Through UltraSMTP

© Meixler Technologies, Inc. All Rights Reserved.