/    Sign up×
Community /Pin to ProfileBookmark

Mail is not going to gmail or yahoo id from my website

Hi,

In my website we have a option for forgot password.If any client enters their registered email id and submits the form then the password will go to that particular registered email id it worked before but now same code is not working .

If the client email id is gmail id or yahoo id then the password is not going to their email id.

For testing in maill() i have changed TO from gmail id into my company email id(example : [email][email protected][/email]) then i clicked submit in that case I received password and other details to my company id.

Can anyone tell me why my mails are not going to gmail or yahoo id’s ?but the same code is working if i give my company email id.

I have pasted code here,

ini_set(‘SMTP’, ‘mailserver01.manashosting.net’); //Suggested by “Some Guy”
ini_set(‘SMTP_port’, 25); //Suggested by “Some Guy”

[code=php]
$user_email =”[email protected]”;
$query = “select user_name,user_pass,user_id from users where user_email = ‘$user_email'”;
//execute the SQL statement
$q1= mysql_query($query) or die(“Error in Query “.$query);
$num = mysql_num_rows($q1);
$i = 0;
while($i < $num)
{
$user_name = mysql_result($q1,$i,”user_name”);
$user_pass = mysql_result($q1,$i,”user_pass”);
$user_id = mysql_result($q1,$i,”user_id”);
$i = $i + 1;

}

$name= “Peter”;
$name1 = “Admin”;
$message = “”.$name.”,n”;
$message1 =”Please find your login details below,n”;
$message2 =”Use your username or email id to login,n”;

$mail_body .= “”.$message.”n”; //mail body
$mail_body .= “”.$message1.”n”; //mail body
$mail_body .= “”.$message2.”n”; //mail body
$mail_body .= “User Name :”.$name.”n”; //mail body
$mail_body .= “Your Email-Id :”.$user_email.”n”; //mail body
$mail_body .= “User Id :”.$user_id.”n”; //mail body
$mail_body .= “Password :”.$user_pass.”n”; //mail body
$recipient = “[email protected]; //recipient
$email=”[email protected]”;

// checking the mode either add or modify

//declare the SQL statement that will query the database
//declare the SQL statement that will query the database
$subject = “Cismak Login details”; //subject
$header = “From: “. $name1 . ” <” . $email . “>rn”; //optional headerfields

mail($recipient, $subject, $mail_body, $header); //mail command 🙂

[/code]

Regards,
Punitha

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @punithapary spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...