Re: Newbie - Setting Up Some Basic Sendmail Scripts
| From: | Maarten Schalekamp | Date: | Tue, 05 May 2009 18:06:35 +0000 |
| Subject: | Re: Newbie - Setting Up Some Basic Sendmail Scripts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292297@lists.php.net to get a copy of this message | ||
i think you will need to make use of a pear package to be able to do this.
pear package: http://pear.php.net/package/Mail
examples: http://blog.thekimsfamily.com/archives/3
docs: http://pear.php.net/manual/en/package.mail.mail.factory.php
http://pear.php.net/manual/en/package.mail.mail.send.phpi dont think the built in php mail function can do authentication. you can only change the settings avaliable in the php.ini ------------------------------------------------------------------------ [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = you@yourdomain ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ------------------------------------------------------------------------ working for the first time with pear packages can sometimes be tricky to get going, but once all is set you wont have any probs. i think this will push you in the right direction "revDAVE" <Cool@hosting4days.com> wrote in message news:C625C359.397AF%Cool@hosting4days.com... [Newbie] Hi folks, I'm trying to set up some basic php send mail scripts - and I'm curious of the best way to go... I checked these basics out: http://us.php.net/manual/en/function.mail.php And got this code below going, but I'll bet I need a bit more - like adding authentication - smtp - port - sending user / pass etc. Any hints how to get this to the next level? Thanks in advance - dave -------------------------------- <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n"; mail($to, $subject, $message, $headers); ?> -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] __________ Information from ESET Smart Security, version of virus signature database 4054 (20090505) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 4054 (20090505) __________ The message was checked by ESET Smart Security. http://www.eset.com