notes for PHP

- "dont forget FROM" otherwise mail() will just fail
- added php code example
This commit is contained in:
gondo 2013-06-06 11:50:37 +10:00
parent a06f51d4bb
commit 9d71c72c42

View File

@ -63,6 +63,18 @@ You can do this in an [Apache htaccess file](http://php.net/manual/en/configurat
If you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run `which catchmail` and put that path into the `sendmail_path` directive above instead of `/usr/bin/env catchmail`.
Don't forget to set 'From' header.
Code example:
~~~
<?php
$to = 'to@domain.tld';
$subject = 'Subject';
$message = 'Message';
$headers = 'From: from@domain.tld';
mail($to, $subject, $message, $headers);
~~~
### Django
For use in Django, simply add the following configuration to your projects' settings.py