Page 1 of 1

Mail()

Posted: Mon Dec 17, 2007 9:10 am
by Chalks
I'm trying to make a simple activation email and... I'm having problems:

Code: Select all

$to = $e;
  $subject = 'Chalksdesign Forum Activation';
  $message = "Welcome to Chalks Design forums, " . $u . ".  To activate your account, please go to the following link:  http://forums.chalksdesign.com/activation.php?u=" . $u . "&code=" . $activationCode . "  Please do not reply to this email.  Thank you!";
  $headers = 'From: forums@chalksdesign.com' . "\r\n" .
    'Reply-To: forums@chalksdesign.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

  mail($to, $subject, $message, $headers);
I'm not receiving any emails, and I can't figure out why. :(


Edit: After reading the php manual more thoroughly, I removed the "\r" from the headers because apparently some unix servers and gmail don't like them. However, It's still not working. I've also tried removing the X-Mailer header, but that doesn't seem to make a difference either. Help, please! :)

Posted: Mon Dec 17, 2007 9:39 am
by feyd
If you insist on using mail() yourself, you will need to add a lot more headers that help with spam filters and other systems.

It is recommended to use Swift Mailer instead, as there are a LOT of nuances that many of us are unaware of making the emails stop somewhere in the line.

Posted: Mon Dec 17, 2007 9:45 am
by Chalks
ugh. I knew you would say that.


The reason I haven't used Swift Mailer is because I've been trying to avoid having to install any libraries... because it scares me.

If I make my server explode (not unlikely), I'm totally blaming you, feyd. :D

Posted: Mon Dec 17, 2007 1:50 pm
by Zoxive
Chalks wrote:ugh. I knew you would say that.


The reason I haven't used Swift Mailer is because I've been trying to avoid having to install any libraries... because it scares me.

If I make my server explode (not unlikely), I'm totally blaming you, feyd. :D
Its not "Installing" anything. Its just simply downloading the files, and running them as needed.

Doesn't suit your needs? Simply delete the files.

Posted: Mon Dec 17, 2007 2:37 pm
by Chalks
Zoxive wrote:Its not "Installing" anything. Its just simply downloading the files, and running them as needed.

Doesn't suit your needs? Simply delete the files.
Yeah. I figured that out about 10 minutes after I posted. :oops:

Now I don't have any excuses. heh.