473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

mail() not working to Y but works to Gmail

Hi all...

A simple mail example like...

<?
mail("acco...@yahoo.com","Subject of Message","Message");
?>

does not work to yahoo or spymac.com, but the same works to gmail and
other servers.

Yahoo and others does not even receive the message. Inbox and Bulk
folders stay empty.

Does anybody have an idea why yahoo or other servers does not receive
the messsage?

Jul 17 '05 #1
9 2830
*** jo*********@yahoo.com wrote/escribió (9 Jun 2005 07:02:47 -0700):
Does anybody have an idea why yahoo or other servers does not receive
the messsage?


If your mail server is configured correctly, your mail to Yahoo is probably
being filtered as spam.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #2
but the problem is that bulk mail folder and inbox folder are empty.

and i can send to gmail...

Jul 17 '05 #3
jo*********@yahoo.com wrote:
Hi all...

A simple mail example like...

<?
mail("acco...@yahoo.com","Subject of Message","Message");
?>

does not work to yahoo or spymac.com, but the same works to gmail and
other servers.

Yahoo and others does not even receive the message. Inbox and Bulk
folders stay empty.

Does anybody have an idea why yahoo or other servers does not receive
the messsage?


I just went through some adventures with this. Perhaps some of what
happened to me may help. My system is Linux, but the ideas should be
generally applicable.

The most important guiding principle is that you are handing information to
a third party, the email server, and therefore you are losing some control,
which you offset with increased logging and alerts.

First, defininitely use Pear Mail instead of mail(). They are not
dramatically different from one another, but I found Pear much easier when
adding more headers, and it just felt smoother when coding. Considering
how much trouble I was having, the small differences were magnified and
Pear Mail suddenly looked mcuh better.

Second, make sure you trap a failure to send. It could be your email server
is off or rejects the mail, so that's the first thing you need to know.
Using Pear, the code is:

$mail_object->send($recipients, $headers, $body);
if (!$mail_object) {
// some action on error
}
else {
// some action on success
} }

Third, make certain that the "FROM" address to the email is reachable by
your mail server no matter what, so that bounced messages will

Fourth, check your server's logs, did they show an attempt to send the mail?
Did they give an error message if failed?

Fifth, if the machine originating the email (your smtp server) is not
identified with a real DNS name, like mail.example.com, then many big shops
like Yahoo and AOL will either route it to Bulk or Spam.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Jul 17 '05 #4
*** jo*********@yahoo.com wrote/escribió (9 Jun 2005 07:27:51 -0700):
but the problem is that bulk mail folder and inbox folder are empty.


I can't speak for Yahoo for I've never used their mail, but some hosts just
reject all mail from servers that do not meet certain (often secret)
conditions:

* IP is not blacklisted.
* Reverse DNS lookup does not resolve to hostname.
* Messages do not include certain words.
* Attachment are not of given type (I know servers that reject ZIP files).

When I said reject I should have said "first accept then drop". Hotmail
used to do so (dropped messages were neither returned nor delivered).

You can do some simple tests:

* Make sure headers include your e-mail address in From field.
* Provide a return address for error messages*.
* Try to send mail through the same server from another client.

(*) mail($to, $subject, $body, "From: $from", "-f$from");

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #5
a guy from another newsgroup post said my IP is in black list, but how
can i change this now?

take a look at what he said...

-------
Probably they are rejecting your mail because 201.17.185.155 is listed
by sbl-xbl, sorbs, and other DNSBLs. njabl.org shows it as an open
proxy, added to their list on May 21. The next day it was added to
opm.blitzed.org.
--------

Jul 17 '05 #6

1&2. Could not initated the mail object...

How do i initiate it? I think i do not have pear....

3. I used another FROM mail like (ot***@gmail.com) but i think you are
assuming a reachable IP.
If it is, my IP is valid on the web.

4. Here goes the mailog

//------------------------------------------

Jun 9 11:44:36 MyServerName sendmail[19677]: j59FiajF019677:
from=root, size=103, class=0, nrcpts=1,
msgid=<200506091544.j59FiajF019...@MyServerName.P4 >,
relay=root@localhost
Jun 9 11:44:36 MyServerName sendmail[19679]: warning:
/etc/hosts.allow, line 6: missing newline or line too long
Jun 9 11:44:36 MyServerName sendmail[19679]: j59FiaL8019679:
from=<r...@MyServerName.P4>, size=316, class=0, nrcpts=1,
msgid=<200506091544.j59FiajF019...@MyServerName.P4 >, proto=ESMTP,
daemon=Daemon0, relay=localhost [127.0.0.1]
Jun 9 11:44:36 MyServerName sendmail[19677]: j59FiajF019677:
to=acco...@yahoo.com, ctladdr=root (0/0), delay=00:00:00,
xdelay=00:00:00, mailer=relay, pri=30075, relay=[127.0.0.1]
[127.0.0.1], dsn=2.0.0, stat=Sent (j59FiaL8019679 Message accepted for
delivery)
Jun 9 11:44:39 MyServerName sendmail[19681]: j59FiaL8019679:
to=<acco...@yahoo.com>, ctladdr=<r...@MyServerName.P4> (0/0),
delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=30288,
relay=mx4.mail.yahoo.com. [66.218.86.156], dsn=5.0.0, stat=Service
unavailable
Jun 9 11:44:39 MyServerName sendmail[19681]: j59FiaL8019679:
SYSERR(root): hash map "Alias0": unsafe map file /etc/aliases.db:
Permission denied
Jun 9 11:44:39 MyServerName sendmail[19681]: j59FiaL8019679:
j59FidL8019681: DSN: hash map "Alias0": unsafe map file
/etc/aliases.db: Permission denied
Jun 9 11:44:39 MyServerName sendmail[19681]: j59FidL8019681:
to=<r...@MyServerName.P4>, delay=00:00:00, xdelay=00:00:00,
mailer=local, pri=31340, dsn=2.0.0, stat=Sent

5. You mean my host must be a internic registered host name? Oh my
god, it ued to... i'm gona make it.

Jul 17 '05 #7
>I can't speak for Yahoo for I've never used their mail, but some hosts just
reject all mail from servers that do not meet certain (often secret)
conditions:

* IP is not blacklisted.
* Reverse DNS lookup does not resolve to hostname.
* Messages do not include certain words.
* Attachment are not of given type (I know servers that reject ZIP files).


There are more conditions than this to worry about. For example,
mail may be rejected :

- The server identified by the From: address (MX records on the domain)
is localhost, 127.0.0.1, a private address, or doesn't exist.
- The server identified by the From: address does not accept any bounce
messages. ( MAIL FROM:<> to the SMTP server always fails, either
immediately or after RCPT TO:).
- The server identified by the From: address will not accept the address
in the From: line as a recipient (Exim callout verify).
- The mail contains an attachment (ANY attachment). This is fairly
unusual, though.
- The mail contains an attachment of apparent executable type
(exe, com, pif, scr).
- The domain identified by the From: address publishes SPF records and
the mail sender isn't listed.
- The domain identified by the From: address is on a list of known
or suspected banks (especially banks being phished) and it fails
to publish SPF records.
- Any domain in the headers (To:, Cc:, Reply-to:, From:) ends in a
period, contains two consecutive periods, or is "<Undisclosed Recipients:;>",
even if the offending domain is not a sender or recipient of this
copy of the message.

Gordon L. Burditt
Jul 17 '05 #8
The most common problem people have with the mail() function is the failure
to include both the envelope from address and the from address in the call.
This commonly results in failed delivery due to spam filtering at the
receiving end. The solution: set your header-from address, or use this
function:

<?
function MAIL_NVLP($fromname, $fromaddress, $toname, $toaddress, $subject,
$message)
{
// copyright © 2005 ECRIA LLC, http://www.ECRIA.com
// This code is free to use and modify as long as this notice remains
unchanged.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
return mail($toaddress, $subject, $message, $headers);
}
?>

ECRIA
http://www.ecria.com
Jul 17 '05 #9
NC
jo*********@yahoo.com wrote:

a guy from another newsgroup post said my IP is in black list,
but how can i change this now?


Secure your SMTP server. If you are not managing it yourself,
ask your provider to do so. If they refuse, there's nothing
you can do.

Cheers,
NC

Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John J. Hughes II | last post by:
First of all does anyone know if the e-mail client in beta 2 works with SSL and or what I did wrong below? Changing to the correct user name and password works with outlook. try {...
4
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet ...
9
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not...
10
by: Frank | last post by:
Hi, I am hoping to find out the differences between the System.Net.Mail and System.Web.Mail. Can some nice folks post the differences; or some urls which show the differences? Great Thanks...
3
by: bombardier | last post by:
I have a PHP script that I copied and modified from the SourceForge.net website that I cannot get to work. The problem seems to be that the value for $mail is not recognized. The script fails...
9
by: nobrow | last post by:
I cannot get php to send an email. This works: $ mail -s "My Subject" nobrow@gmail.com My Message ^D Cc: But this doesnt:
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
5
by: sui | last post by:
this is my code import sys, os, glob, datetime, time import smtplib ## Parameters for SMTP session port=587 SMTPserver= 'smtp.gmail.com' SMTPuser= '...@gmail.com' pw= 'fill in here'...
6
by: phpmagesh | last post by:
Hi, I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details, problem is when i send mail it simple through waring msg...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.