Location: PHPKode > scripts > dSendMail2 > dsendmail2-2-0/example-SMTPSend.php
require_once "dSendMail2.inc.php";

// First of all: DISABLE TIME LIMIT and IGNORE USER ABORT! You really don't want to be interrupted in the middle of this.

// Parameters:
// ->sendThroughSMTP($smtp_server, $port=25, $user=false, $pass=false, $ssl=false)

$m = new dSendMail2;
$m->setSubject("SMTP Test");
$m->setMessage("Here goes my message, through SMTP server.");

// EXACTLY THE SAME CODE as any other example.. Except for the line below:
$m->sendThroughSMTP("smtp.myserver.com", 25, "my_user", "password");

// Real GMail example:
$m->sendThroughSMTP("smtp.gmail.com", 465, "hide@address.com", "yourpassword", true);

// You can still send mass mails, attachments, embedded images... Do what you want!

Return current item: dSendMail2