PHP Classes

File: SendEmail-example.php

Recommend this page to a friend!
  Classes of Sceptre   Simple External SMTP   SendEmail-example.php   Download  
File: SendEmail-example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple External SMTP
Send e-mail messages via SMTP with authentication
Author: By
Last change:
Date: 11 years ago
Size: 825 bytes


Class file image Download
die('remove this');

//test script for class_email

require 'SendEmail.php';
//require 'class_email-small.php';

$e = new SendEmail();
$e->set_server( 'mail.local', 25);
//$e->set_server( '', 587);

$e->set_auth('your smtp username', 'your smtp password');

$e->set_sender( 'Name of sender', 'email@ofsender.local' );

$e->set_hostname('some servers require a valid rdns name');

$subject = 'This is a text subject Ää, Öö, Üü';
$body = "This is the test body of the message\r\nIt may contain special characters: Ää, Öö, Üü\r\n";

$e->mail('send@mailto.local', $subject, $body);

'last: '.$e->srv_ret['last']."\n";
'all: '.$e->srv_ret['all']."\n";