473,395 Members | 1,418 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 with pear... i don't understand...


hi all

i must send a mail from a php form. ok. i have pear installed. ok.

this is my code:

<?
include("Mail.php");
$recipients = "in**@domain.com";
$headers["To"] = "in**@domain.com";
$params["host"] = "mail.domain.com";
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = "ac*****@domain.com";
$params["password"] = "password";
$headers["Subject"] = "Test Mail";

$mail_body = "\r\n";
$mail_body .= "-----------------------------\r\n";
$mail_body .= "TEST MAIL TEST MAIL TEST MAIL\r\n";
$mail_body .= "-----------------------------\r\n";
$mail_body .= "\r\n";

$headers["From"] = "John Doe <ac*****@domain.com>";
$mail_object =& Mail::factory("smtp", $params);
$mail_object->send($recipients, $headers, $mail_body);
}
?>

the thing I can't understand is: i try to make this code connect to
mailserver A (mail.domain.com), with authentication, and all is ok. no, not
all: I write to 2 differents address (by changing the parameters in the
code) and an address receives mail, the other one doesn't receive any mail.
I try to use the same server by using my standard mail client, and I can
reach both address. first thing I don't understand. someone can tell me
what's happening? :-)

the second thing is that if I try to use another mailserver
(mail.otherdomain.com) the script doesn't run at all. I try to strip away
the auth code, but nothing. maybe the server must have some option
enabled/disabled to be reachable by php/pear?

thanx in advance
d.

--
La bella che guarda il fiume ha un nome che fa paura...
La bella che č addormentata ha un nome che fa paura:
Libertą! Libertą! Libertą!
Jul 17 '05 #1
1 1438
NC
L'astemio wrote:

i try to make this code connect to mailserver A (mail.domain.com),
with authentication, and all is ok. no, not all: I write to 2
differents address (by changing the parameters in the code) and
an address receives mail, the other one doesn't receive any mail.
I try to use the same server by using my standard mail client,
and I can reach both address. first thing I don't understand.
someone can tell me what's happening? :-)
Most likely, the second server filters PHP-generated messages out
based on something it reads in the message headers. Compare the
headers of PHP-generated message with those of the message sent
with a standard client program; this may give you some clues.
the second thing is that if I try to use another mailserver
(mail.otherdomain.com) the script doesn't run at all.


Are any error messages displayed?

Cheers,
NC

Jul 17 '05 #2

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

Similar topics

2
by: Alvaro G Vicario | last post by:
I'm trying to send e-mail using PEAR's Mail class--for testing purposes actually, I've never had any problem with conventional mail(). This is what my code looks like: ...
0
by: NotGiven | last post by:
Ok, I THINK I have access to the PEAR packages in my /path/to/pear/... directory. I tested a simple php page with just : require("/path/to/pear/Mail.php"); and the page displayed properly so I...
9
by: joealey2003 | last post by:
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.
0
by: Mike Wasilewski | last post by:
I am just setting up a win 2003 server running IIS6 , php, with pear packages installed. I am trying to get the Pear Mail package working but cannot get it to send a message and it returns no...
5
by: crescent_au | last post by:
Hi all, I've been using PHP for a while now but I haven't actually used PEAR. I have just read half a chapter in a book, it sounds alright but haven't actually used it. I was just wondering, is...
3
by: berkshire | last post by:
I installed the Pear mail package and then created a quick script using the example from http://pear.php.net/manual/en/package.mail.mail.send.php I getting the following error: Fatal error: Call...
1
by: techjohnny | last post by:
I have the following code, I can send e-mail to:, cc:, and bcc:, but what if I want to add another cc? I'm using PEAR's Mail.php. $hdrs= $From; $hdrs= $To; $hdrs= $Subject; $recipients =...
3
by: maheswaran | last post by:
Hi , Am new in PEAR. I have using PEAR/Mail.php for sending mails using smtp authentication. Here that my mailto form. <?php session_start(); ini_set("smtp_port",25); include("Mail.php");...
5
by: jeddiki | last post by:
I am building my subscriber list which is held in the mySQL database "client" table and I want to start sending them a newsletter. My list will probably get up to around 20,000 I would like...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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.