Jump to content

[SOLVED] PHP Mail - Alts?


Lamez

Recommended Posts

I am using the PHP mail function to send activation emails to the newly registered member. Well it worked with gmail, but yahoo does not seem to receive anything at all. Are there alternative ways of sending emails?

 

Here is my code:

<?php
function sendMail($user){
  $to = findInfo($user, "email");
  $id = findInfo($user, "id");
  $hash = md5($user.$id.$user);
  $link = "http://www.lamezz.com/test/register.php?act=".$hash;
  $subject = 'Activate Account!';
  $message = "Please copy and paste the link into your browser to activate your account at Lamez's Corner! \n".$link."\n -Thank You\n Lamez");
  $headers = "From: [email protected]\r\nReply-To: [email protected]";
  $mail_sent = @mail( $to, $subject, $message, $headers );
  return $mail_sent ? "Mail sent to ".$to : "Mail failed";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/140366-solved-php-mail-alts/
Share on other sites

The PEAR library has a mail function which is quite powerful.

 

Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.
Link to comment
https://forums.phpfreaks.com/topic/140366-solved-php-mail-alts/#findComment-734663
Share on other sites

If you add the more constructed header's your get there,

most email server wont let email's in unless there headers are properly formatted.

 

Also email's get seen as spam unless the ip sending the email is on there non spamming list.

 

For example.

 

If you join a hosting account that has been reported as a host that has lots off spam your xxxxxxxxxx

 

or the host has not set the dns correctly your xxxxxx

 

There many things wrong with your current posted code, for established email servers to accept your email's.

 

lack off header info is one.

Link to comment
https://forums.phpfreaks.com/topic/140366-solved-php-mail-alts/#findComment-734668
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.