Jump to content

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: no-reply@lamezz.com\r\nReply-To: no-reply@lamezz.com";
  $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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.