Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,673 members, 7,823,905 topics. Date: Friday, 10 May 2024 at 05:51 PM

Php Mail() To Yahoo Inbox Help Needed - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php Mail() To Yahoo Inbox Help Needed (8176 Views)

Teenager Sells Mobile Startup To Yahoo for $30 Million / Tool To Send Mail To Bulk Email Address / What Happened To Yahoo Chat? (2) (3) (4)

(1) (2) (Reply) (Go Down)

Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 10:48pm On Mar 09, 2009
please i use php to script and i am working on a website where users are to send messages to thier friends and an alert is to be sent to the recipents email inbox, i have done that successfully but the problem is that the mails never get dilivered to yahoo boxes please can anyone help?
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 10:58pm On Mar 09, 2009
Post your code.

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 11:01pm On Mar 09, 2009
************
//this is just the mail part

$to = $_POST['to'];
$msg = $_POST['mail'];
$subject = $_POST['subject'];
$from = $_POST['from'];

mail($to, $subject, $msg, $from);
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 11:15pm On Mar 09, 2009
So far, you have the right syntax for the mail(); I think the problem lies with your hosting company. Are you sure mail function is enabled on your host? phpinfo your server and post a snap shot.

Rather, post your full code in here and lets check where the error is coming from

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 11:36pm On Mar 09, 2009
yes they(my hosting server) support sending of mails. i said that mails go to gmail accounts but not to yahoo and i just wanted to figure out what the problem might be
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 11:46pm On Mar 09, 2009
I will still suggest you provide your code in full or check that your IP is not blacklisted.\

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by aphoe(m): 2:27am On Mar 10, 2009
your mails might probably be going to the yahoo spambox. there is a 5th (optional) argument for the mail() function. i.e. $header, if you work on it, you'll probably successfully send a mail into yahoo inbox
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 8:06am On Mar 10, 2009
@aphoe

I do not think your contribution is true. Working around email header IS not a guarantee that your email will deliver to the inbox. If you have facts regarding your contribution, post it. The poster should post his full code and also check that his shared IP is not on a blacklist.

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 11:21am On Mar 10, 2009
i changed the $from to $header but it didnt reflect in my post cause it was the old code i copied but the thing is how would i know if my shared ip is blacklisted. and shared ip as in host company's ip?
Re: Php Mail() To Yahoo Inbox Help Needed by Nobody: 8:09pm On Mar 10, 2009
Paste the full code here if you want a proper review. . .otherwise go and download something from phpclasses.org. . .i'm out. . .
Re: Php Mail() To Yahoo Inbox Help Needed by Nobody: 8:59pm On Mar 10, 2009
you need to change the envelope address else it will land in junk folder
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 9:41pm On Mar 10, 2009
@ webdezzi

Are you suggesting that the envelope address is what is causing an email to land in junk?? Please enlighten me

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by Nobody: 9:43am On Mar 11, 2009
yes,
if he checks the full headers of the mail going to bulk, the envelope address will be the address set in the server's php.ini file.
Which is probably different from the sender's email he defined.

he can either use the mail's function's 5th parameter

mail('email@email.com', 'the subject', 'the message', "From: $fromEmail", "-f $fromEmail");

or set it using the ini_set()

ini_set(sendmail_path, "/usr/sbin/sendmail -t -f $fromEmail"wink;

My host, hostmonster seems to set it for you on the fly, but some naija host will not

if you still have problems sending it.
you can add additional headers.
Below is a tutorial i wrote on it, that was when i got a solution to the problem at that time



<?php
//July 31st 2007
//This email script will deliver to all email clients
//Hotmail will put hers in junk folder, until the reader marks it as safe, once marked safe,
//subsequent emails will arrive to inbox safely

//set variables
$sender_name="Ajai Oluwaseun";//set the name that appears to the reciever
$subject="Test Email";
$message = "Thanks for reading my tutorials";
$to="seunemma@hotmail.com";//send to multiple by separating with comma
$from="seun@sadeeb.com.ng";

//Uncomment the next line to send carbon copy
$cc="sledgehammer23401@yahoo.com";//send to multiple by separating with comma

//Uncomment the next line to send blind carbon copy
$bcc="seunemma@yahoo.com";//send to multiple by separating with comma

//lets change the envelop address to the one we are using
ini_set(sendmail_path, "/usr/sbin/sendmail -t -f $from"wink;
//date as at the time we are sending it
$date= date("r"wink;

//set all necessary headers
$headers = "From: $sender_name<$from>\n";
$headers .= "Reply-To: $sender_name<$from>\n";
$headers .= "X-Sender: $sender_name<$from>\n";
$headers .= "X-Mailer: PHP4\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Content-Transfer-encoding: 8bit\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: 3\n";
$headers .= "Date: $date\n";
$headers .= "Delivered-to: $to\n";
$headers .= "Return-Path: $sender_name<$from>\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\n";

//Uncomment the next line to send html format
//$headers .= "Content-Type: text/html; charset=iso-8859-1\n";

//Uncomment the next line if you are sending carbon copy
//$headers .= "cc: $cc\n";

//Uncomment the next line if you are sending blind carbon copy
//$headers .= "bcc: $bcc";

//its time to send our mail
mail($to,$subject,$message,$headers);

//seing is believing
echo "mail sent to $to<br><br>$cc<br><br>$bcc";

?>
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 11:34am On Mar 11, 2009
thank you very much guys u have made my day and my code is
<?php
//variables declaration
$to = $_POST['to'];
$msg = $_POST['mail'];
$subject = $_POST['subject'];
$from = $_POST['from'];

@mail($to, $subject, $msg, $from);
header("location:index.php"wink;

?>
that is the full code
Re: Php Mail() To Yahoo Inbox Help Needed by Nobody: 3:42pm On Mar 11, 2009
$from = $_POST['from']; shud be $from = "From: ".$_POST['from'];

and try resetting the sendmail_path by adding
ini_set(sendmail_path, "/usr/sbin/sendmail -t -f $_POST['from']);

use this

<?php
//variables declaration
//function to check email if submitted by user

function verify_email($email){

if(!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/',$email)){
return false;
} else {
return $email;
}
}

$to = $_POST['to'];

if(!verify_email($to))
{echo "Wrong email provided"; exit();}


$msg = $_POST['mail'];
$subject = $_POST['subject'];
$from = $_POST['from'];

$date= date("r"wink; //get the date to use here, Developers, note that this date can be faked.

ini_set(sendmail_path, "/usr/sbin/sendmail -t -f $from"wink; //you can confirm this path in you Cpanel home, the left bar

$headers = "From: $sender_name<$from>\n";
$headers .= "Reply-To: $sender_name<$from>\n";
$headers .= "X-Sender: $sender_name<$from>\n";
$headers .= "X-Mailer: PHP4\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Content-Transfer-encoding: 8bit\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: 3\n";
$headers .= "Date: $date\n";
$headers .= "Delivered-to: $to\n";
$headers .= "Return-Path: $sender_name<$from>\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\n";


$sent=@mail($to, $subject, $msg, $headers);

/* my personal preference below */

if($sent)
{
//code to run if sent
}else{
//code to run if failed
}
//header("location:index.php"wink;

?>
Re: Php Mail() To Yahoo Inbox Help Needed by Emeka72(m): 6:02pm On Mar 11, 2009
I've unable 2 send yahoo! wats d cause, is any experiencin d same or is it a general problem?
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 2:06am On Mar 12, 2009
how do you mean if you can be a bit clearer maybe i can now be of help, and i am sure nairalanders would be there for you
Re: Php Mail() To Yahoo Inbox Help Needed by Emeka72(m): 3:13am On Mar 12, 2009
is yahoo! mail sending goinh?
Re: Php Mail() To Yahoo Inbox Help Needed by Emeka72(m): 11:26am On Mar 12, 2009
@Mikky, Weneva I try sending Yahoo! mail, d reply I get : Service temporarily unavaglable
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 9:32pm On Mar 12, 2009
do you mean you have been finding it difficult to send emails from your yahoo account?
Re: Php Mail() To Yahoo Inbox Help Needed by jmslimx(m): 7:12am On Mar 13, 2009
use this method and maybe your server doesnt support php or sendmail


<?php
session_start();

$ip = getenv("REMOTE_ADDR"wink;
$fullname = $HTTP_POST_VARS["fullname"];
$address = $HTTP_POST_VARS["address"];
$email = $HTTP_POST_VARS["email"];
$country = $HTTP_POST_VARS["country"];
$tel = $HTTP_POST_VARS["tel"];
$msg = $HTTP_POST_VARS["msg"];
$do = "mail";
$mesaj = "your message frm
Full Name : $fullname
Address : $address
Email : $email
Country : $country
Telephone : $tel
Message : $msg
----------------------------------------------------
IP : $ip
";

$recipient = "info@yourcompany.com";
$subject = "My online form";

mail($recipient,$subject,$mesaj,$name);

header("Location: http://www.urwebsite.com");
?>
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 8:07am On Mar 13, 2009
@jmslimx

I don't need to elaborate on your code. You have copied this code from one of those flying phishing scam pages all over the internet. No grudge!

To my point, I would advice the poster not to use the code provided my jmslimx as it all rely on register globals being turn on. This was a feature removed from PHP since 2002. Most hosting company has turned off the feature shocked

If you need a working email form script, i can write one for you quickly. Just provide your html form here.

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by segsalerty(m): 4:10pm On Mar 13, 2009
Uhmm , the last 2 posts here are too and over Funny grin grin grin LOL!
am off here , lipsrsealed lipsrsealed lipsrsealed not talking
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 4:13pm On Mar 13, 2009
@ segsalerty

you think it is funny? brov, I no think so ooo. Na my view be that

- nitation
Re: Php Mail() To Yahoo Inbox Help Needed by segsalerty(m): 11:03pm On Mar 13, 2009
Uhmm , Its just being funny ! your view was like Cat and mouse's View! you caught the mouse real smart ! its not easy na , na all of us wan dey do EFIKO here cheesy! We are all webmasters ! tongue tongue tongue.
so, leave us alone oooooooo grin
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 2:27am On Mar 14, 2009
@websezzi both did not work i did not change a thing in your code apart from the $to and it still doesnt enter my mail box which is the testing location for now till it can work out.
Re: Php Mail() To Yahoo Inbox Help Needed by Emeka72(m): 8:53am On Mar 14, 2009
yes Mikkytrio I'v been having dificulty sending yahoo! mails frm my address.
Re: Php Mail() To Yahoo Inbox Help Needed by Nobody: 3:50pm On Mar 14, 2009
it did not enter ur mailbox at all or it went to junk?
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 3:58pm On Mar 14, 2009
well @emeka i have been sending emails from my yahoo box well and have not had any cause to complain yet, just sign out and in again and try resending
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 2:17am On Mar 15, 2009
@webd
it did not even reflect in my box at all
Re: Php Mail() To Yahoo Inbox Help Needed by mikkytrio(m): 2:20am On Mar 15, 2009
sorry just got it in my gmail inbox but not in hotmail or yahoo
Re: Php Mail() To Yahoo Inbox Help Needed by nitation(m): 9:03am On Mar 15, 2009
This is a host related issue.

- nitation

(1) (2) (Reply)

How Can I Create A Football Prediction Site Like Zulubet / Can Bloggers In Other Niches Have This Many Posts? (Picture / 5 Benefits Of .NG Domain Extension - Techinfo

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 36
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.