<?php
include "sendmail.class.php";
$Mail = new sendmail();
// Set congif
$Mail->SendMailVia = 'smtp'; // Send via smtp server or mail function
$Mail->smtp_host = 'mail.myhost.com';
$Mail->smtp_port = 25;
$Mail->smtp_user = 'user@myhost.com';
$Mail->smtp_password = 'mypassw';
// Example 1 (mail from me)
if($Mail->Send('mymail1@mydomain.com; recipient2 name <recipientmail2@mydomain.com>,"recipient name" <recipient@mail.com>','My subject','My message here.'))
{
echo 'message Mail send!';
}
else
{
echo $Mail->error;
}
// Example 2 (mail from me)
$Mail->mail_to = 'mymail1@mydomain.com; recipient2 name <recipientmail2@mydomain.com>,"recipient name" <recipient@mail.com>';
$Mail->subject = 'My subject';
$Mail->message = 'My message here';
if($Mail->Send())
{
echo 'message Mail send!';
}
else
{
echo $Mail->error;
}
// Example 3 (mail from another user: example user2@site2.com)
$Mail->mail_to = 'Recipient Name <recipientmail@domain.com>';
$Mail->subject = 'My subject';
$Mail->message = 'My message here';
$Mail->from_name = 'User2 Name';
$Mail->SendFromMail = 'user2@site2.com';
if($Mail->Send())
{
echo 'message Mail send!';
}
else
{
echo $Mail->error;
}
?>
|