473,498 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with the function "mail" of PHP.

Hi everybody,

I have a problem with the function "mail". It returns "true"
but supposed recipients receive nothing. My code is as follows:

$to = $form[address1];
$subject = "E-mail Verification";
$body = 'The first line\n';
$body .= 'The second line.';
$headers = 'From: we*******@example.com';
$res = mail($to, $subject, $body, $headers);

I tried to send messages to two different e-mail addresses (to my yahoo
account and on my university one). No one mail-box got the message. I
also checked the bulk folder of the yahoo mail, it is also empty. Gould
you please help me to solve this problem?

Nov 26 '06 #1
6 1696
"Kurda Yon" <ku******@yahoo.comwrote in news:1164554494.863051.105600
@f16g2000cwb.googlegroups.com:
Hi everybody,

I have a problem with the function "mail". It returns "true"
but supposed recipients receive nothing. My code is as follows:

$to = $form[address1];
$subject = "E-mail Verification";
$body = 'The first line\n';
$body .= 'The second line.';
$headers = 'From: we*******@example.com';
$res = mail($to, $subject, $body, $headers);

I tried to send messages to two different e-mail addresses (to my yahoo
account and on my university one). No one mail-box got the message. I
also checked the bulk folder of the yahoo mail, it is also empty. Gould
you please help me to solve this problem?
start debugging, at the very least find out what is returned by $res

Nov 26 '06 #2
start debugging, at the very least find out what is returned by $res
The main problem is that I do not know from what should I start the
debugging. I have no output to analyses. This function is like a
"black box". I red the description of this function and tried to
full fill all requirement of the correct usage. But id does not work.

Nov 26 '06 #3
"Kurda Yon" <ku******@yahoo.comwrote in news:1164577558.670931.298410@
45g2000cws.googlegroups.com:
>start debugging, at the very least find out what is returned by $res
The main problem is that I do not know from what should I start the
debugging. I have no output to analyses. This function is like a
"black box". I red the description of this function and tried to
full fill all requirement of the correct usage. But id does not work.
try using this class, it's great, and i presume it will do some debugging
output in case it fails for you:

http://phpmailer.sourceforge.net/
Nov 26 '06 #4
>I have a problem with the function "mail". It returns "true"
>but supposed recipients receive nothing. My code is as follows:

$to = $form[address1];
$subject = "E-mail Verification";
$body = 'The first line\n';
$body .= 'The second line.';
$headers = 'From: we*******@example.com';
$res = mail($to, $subject, $body, $headers);
The domain example.com has no MX records and no mail server running
on the host pointed at by the A record. This is more than sufficient
to drop any mail claiming to be from example.com as SPAM.

What mail server are you using to send the mail? (Examine your settings
or the default ones and make sure they are appropriate.) Local sendmail?
Look at its logs. Did a message come in at all?
>I tried to send messages to two different e-mail addresses (to my yahoo
account and on my university one). No one mail-box got the message. I
also checked the bulk folder of the yahoo mail, it is also empty. Gould
you please help me to solve this problem?
Nov 26 '06 #5
Gordon Burditt wrote:
>>I have a problem with the function "mail". It returns "true"
but supposed recipients receive nothing. My code is as follows:

$to = $form[address1];
$subject = "E-mail Verification";
$body = 'The first line\n';
$body .= 'The second line.';
$headers = 'From: we*******@example.com';
$res = mail($to, $subject, $body, $headers);


The domain example.com has no MX records and no mail server running
on the host pointed at by the A record. This is more than sufficient
to drop any mail claiming to be from example.com as SPAM.

What mail server are you using to send the mail? (Examine your settings
or the default ones and make sure they are appropriate.) Local sendmail?
Look at its logs. Did a message come in at all?

>>I tried to send messages to two different e-mail addresses (to my yahoo
account and on my university one). No one mail-box got the message. I
also checked the bulk folder of the yahoo mail, it is also empty. Gould
you please help me to solve this problem?

Gordon,

I suspect he was doing exactly as recommended - using example.com when
posting an example, instead of a real email address which could be
harvested by spammers.

I do exactly the same thing when posting code. That's what example.com
is reserved for.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 27 '06 #6
"Gordon Burditt" <go***********@burditt.orgpíše v diskusním příspěvku
news:12*************@corp.supernews.com...
I have a problem with the function "mail". It returns "true"
but supposed recipients receive nothing. My code is as follows:

$to = $form[address1];
$subject = "E-mail Verification";
$body = 'The first line\n';
$body .= 'The second line.';
$headers = 'From: we*******@example.com';
$res = mail($to, $subject, $body, $headers);

The domain example.com has no MX records and no mail server running
on the host pointed at by the A record. This is more than sufficient
to drop any mail claiming to be from example.com as SPAM.
Here you see the reason of your problem :-)
For example if you are sending mail from domain www.superhost.com then you
must use some like
$headers = 'From: go****@superhost.com';
In other word the part of mail after "@" must be the same as your domain
name after "www."
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Nov 27 '06 #7

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

Similar topics

0
1213
by: AvMailGate | last post by:
* * * * * * * * * * * * * * * AntiVir ALERT * * * * * * * * * * * * * * * This version of AntiVir is licensed and full featured. AntiVir has detected the following in a mail from your address: ...
0
1298
by: Vexira | last post by:
* * * * * * * * * * * * * * * Vexira ALERT * * * * * * * * * * * * * * * This version of Vexira MailArmor is licensed and full featured. Vexira has detected the following in a mail from your...
3
2274
by: Jason Steeves | last post by:
I need to replicate the code that is found in Internet Explorer File->send page by e-mail. Can someone tell me how to replicate this code or just call this function. I need to program it to be...
3
57580
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
4
1647
by: Screaming Eagles 101 | last post by:
How can I make my own Mail control (unvisible one) to use with a form ? Does anyone know where to find code ? I would like to fill in some parameters, and then send a mail, a bit like this : ...
9
13992
bonski
by: bonski | last post by:
hello everybody.. i just want to know what this error means... Error: mail() : SMTP server response: 501 #5.1.1 bad address the smtp set up was correct.. valid emails... and port. so im just...
1
1476
by: laredotornado | last post by:
Hi, I cannot seem to send emails. What does it mean when the return value from the "mail" function is an empty string? I'm using php 4.3.11 on a Yahoo! hosting environment. Here is the code:...
2
2560
by: shil | last post by:
Hi all, I'm using System.Net.Mail (Framework 2.0) to send emails on scheduled basis. This works great on Windows 2000 server. Rently we have upgraded our servers to Windows 2003. Since then some...
1
3038
by: =?Utf-8?B?VGFsYWxTYWxlZW0=?= | last post by:
i have facility in my website which sends an e-mail to the cleint's inbox..... i am getting a problem when ever i sends an e-mail.. i tried with Hotmail and Yahoo, e-mail goes to the "Junk Mail"...
0
7005
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
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
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...
1
6891
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
7381
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...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.