note 82433 added to ref.mail
| From: | contact at xpertmailer dot com | Date: | Thu, 10 Apr 2008 17:19:09 +0000 |
| Subject: | note 82433 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138105@lists.php.net to get a copy of this message | ||
In reply to anschwartz. If you don't want to install a mail server you can use a free external
SMTP mail server to send your mails (like Gmail) with a free PHP Class (like XPertMailer, Zend
Framework Mail, PHPMailer or PEAR Mail). Send mail using Gmail and XPertMailer v.4
(http://www.xpertmailer.com/) :
<?php
// path to 'MAIL.php' file from XPM4 package
require_once '/path-to/MAIL.php';
$m = new MAIL; // initialize MAIL class
$m->From('username@gmail.com'); // set From mail address
$m->AddTo('client@destination.net'); // add To mail address
$m->Subject('Hello World!'); // set your mail subject
// set your mail message (text/html)
$m->Html('<b>HTML</b> <u>message</u>.');
// connect to MTA server 'smtp.gmail.com' port '465' via SSL ('tls'
encryption)
// with authentication: 'username@gmail.com' and 'password'
// set the connection timeout to 10 seconds, the name of your
// host 'localhost' and the authentication method to 'plain'
// make sure you have OpenSSL module (extension) enable on your php configuration
$c = $m->Connect('smtp.gmail.com', 465, 'username@gmail.com',
'password',
'tls', 10, 'localhost', null, 'plain') or die(print_r($m->Result));
// send mail relay using the '$c' resource connection
echo $m->Send($c) ? 'Mail sent !' : 'Error !';
// disconnect from server
$m->Disconnect();
?>
----
Server IP: 69.147.83.197
Probable Submitter: 85.120.107.251
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- https://master.php.net/note/edit/82433
Del: integrated -- https://master.php.net/note/delete/82433/integrated
Del: useless -- https://master.php.net/note/delete/82433/useless
Del: bad code -- https://master.php.net/note/delete/82433/bad+code
Del: spam -- https://master.php.net/note/delete/82433/spam
Del: non-english -- https://master.php.net/note/delete/82433/non-english
Del: in docs -- https://master.php.net/note/delete/82433/in+docs
Del: other reasons-- https://master.php.net/note/delete/82433
Reject -- https://master.php.net/note/reject/82433
Search -- https://master.php.net/manage/user-notes.php