SMTP with PHP
- Started
- Last post
- 9 Responses
- PromotionalUseOnly
Anyone know of any good tutorials for sending out mail via SMTP... the php mail facility doesn't seem very reliable particulary with gMail
- Fariska0
correct me if i am wrong: you need a php tutorial via the smtp of your hosting company, right?
- Fariska0
when i had to do it i used this pretty well documented tutorial:
http://www.sephiroth.it/tutorial…- this one as well is very complete:
http://www.sitepoint…
Fariska
- this one as well is very complete:
- moth0
Good class here: http://www.xpertmailer.com/
- PromotionalUseOnly0
blimey the first time ever, some proper answers from people... many thanks... i'm doing stuff through another provider, and not my server... and really annoying things keep happening... and having to ask to be able to build a new database table gets quite annoying!
- PromotionalUseOnly0
thanks both of you, used moth one in the end, and it worked!.. just need to work out how to put names into the header... why are they never well documented these things... i think i've used this one before and gave up... just have more willpower today i think
- PromotionalUseOnly0
hmm... how do i add names to the header?
- neverblink0
all headers must comply to RFC2822 http://www.faqs.org/rfcs/rfc2822…
if you mean adding names to emailadresses use "your name < instead of just the email.
so for example:
$to = "bill gates <
- maximillion_0
if (strtoupper(substr(PHP_OS,0,3... {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3... {
$eol="\r";
} else {
$eol="\n";
}
$headers .= 'From: '.$from.$eol;
$headers .= 'Bcc: '.$bcc.$eol;
$headers .= 'Reply-To: '.$from.$eol;
$headers .= 'Return-Path: '.$from.$eol;
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion();$mailSend = mail($to,$re,$msg,$headers);
- moth0
I wish my problems were still this simple.
- they still have the booze ban on the tube eh?maximillion_
- yup...moth
- fockersmaximillion_