Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get PHP mail() to work? Need help configuring a MTA
    primarykey
    data
    text
    <p><strong>Update: I solved it. Documented everything below.</strong></p> <p>I tried so many things, but it just would not work.</p> <p>I wouldn't mind using, postfix, exim4, or sendmail. I just need a step by step guide and explanation of what am I doing. I am also using Google Apps for e-mail.</p> <p><strong>Edit:</strong></p> <p>mail.log </p> <pre><code>Nov 3 01:14:02 mugbear postfix[16615]: error: to submit mail, use the Postfix sendmail command Nov 3 01:14:02 mugbear postfix[16615]: fatal: the postfix command is reserved for the superuser </code></pre> <p>What does this mean?</p> <hr> <p>Update to edit: Fixed by correcting sendmail_path in php.ini with <code>sendmail_path = /usr/sbin/sendmail -t -i</code></p> <p><strong>Edit2:</strong> PHP - Just grabbed from documentation. FYI, I removed my e-mail.</p> <pre><code>&lt;?php // The message $message = "Line 1\nLine 2\nLine 3"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('removed@gmail.com', 'My Subject', $message); ?&gt; </code></pre> <p><strong>Edit3:</strong> Another error:</p> <pre><code>Nov 3 07:22:29 mugbear postfix/postdrop[17131]: warning: unable to look up public/pickup: No such file or directory Nov 3 07:22:29 mugbear postfix/postdrop[17133]: warning: unable to look up public/pickup: No such file or directory </code></pre> <hr> <p>Update to edit3: Fixed this with the following link: <a href="http://ubuntuforums.org/showthread.php?t=666018" rel="nofollow">http://ubuntuforums.org/showthread.php?t=666018</a> Run this:</p> <pre><code>sudo mkfifo /var/spool/postfix/public/pickup sudo /etc/init.d/postfix restart </code></pre> <p>After that, you'll get this error:</p> <pre><code> postfix/master[13902]: fatal: bind 0.0.0.0 port 25: Address already in use </code></pre> <p>Then you will have to check your processes and kill sendmail processes, for example:</p> <pre><code>root@server:/etc/postfix# ps aux | grep mail root 23554 0.0 0.0 8232 1900 ? Ss 10:17 0:00 sendmail: MTA: accepting connections root 27308 0.0 0.0 3004 764 pts/0 S+ 10:30 0:00 grep mail root@server:/etc/postfix# kill 23554 </code></pre> <p><strong>Edit4:</strong> What does this mean?</p> <pre><code>Nov 3 07:34:51 mugbear postfix/pickup[17309]: 6602F1C151: uid=33 from=&lt;www-data&gt; Nov 3 07:34:51 mugbear postfix/cleanup[17311]: 6602F1C151: message-id=&lt;20101103073451.6602F1C151@mugbear.xen.prgmr.com&gt; Nov 3 07:34:51 mugbear postfix/qmgr[17310]: 6602F1C151: from=&lt;www-data@mugbear.com&gt;, size=397, nrcpt=1 (queue active) Nov 3 07:34:51 mugbear postfix/error[17321]: 6602F1C151: to=&lt;mugbear@gmail.com&gt;, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=4.3.5, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=xen.prgmr.com type=A: Host found but no data record of requested type) </code></pre> <hr> <p>Update to edit4: I ran, <code>dpkg-reconfigure postfix</code> and selected <code>Internet Site</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload