Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2007, 02:14 PM
Registered User
 
Join Date: Oct 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default sending mail through php

its a long message. if anybody have
enough time please take a look
at this . i have incorporated
the code and all the error message here.

i am trying to send mail using
php script which is running
in my local computer(windows xp sp2).though
php mail function evalutaes true
for sending mail but the
smtp server cannot deliver the
mail to the destination.

here is the code for sending the mail
$to = "[email protected]";
        $subject = "RSS- NEW registration";
        $body ="Mail Demo";
        //ini_set('sendmail_from', "[email protected]");

        $header = "From:zico <[email protected]>\r\n";
        $header .= "Reply-To:[email protected]\r\n";
        $header .= "X-Mailer: PHP/" . phpversion() . "\r\n";
        $header .= "X-Priority: 1";
        $sent =mail($to, $subject, $body,$header);
        echo $sent."\n";
        if ($sent) {
           echo $body."\n";
         echo("<p>Message successfully sent!</p>");
             } else {
             // echo("<p>Message delivery failed...</p>");
         }

it shows following error
in bad file

From: postmaster@misu-7be13ecfff
To: you@yourdomain
Date: Thu, 18 Oct 2007 00:55:36 +0600
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
    boundary="9B095B5ADSN=_01C810EED70A423600000001mis u?7be13ecfff"
Message-ID: <wSA1XvpFV00000001@misu-7be13ecfff>
Subject: Delivery Status Notification (Failure)

This is a MIME-formatted message.
Portions of this message may be unreadable without a MIME-capable mail program.

--9B095B5ADSN=_01C810EED70A423600000001misu?7be13ecf ff
Content-Type: text/plain; charset=unicode-1-1-utf-7

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

       [email protected]




--9B095B5ADSN=_01C810EED70A423600000001misu?7be13ecf ff
Content-Type: message/delivery-status

Reporting-MTA: dns;misu-7be13ecfff
Received-From-MTA: dns;misu-7be13ecfff
Arrival-Date: Thu, 18 Oct 2007 00:55:31 +0600

Final-Recipient: rfc822;[email protected]
Action: failed
Status: 5.0.0
Diagnostic-Code: smtp;501 Syntax error in parameters or arguments


--9B095B5ADSN=_01C810EED70A423600000001misu?7be13ecf ff
Content-Type: message/rfc822

Received: from misu-7be13ecfff ([127.0.0.1]) by misu-7be13ecfff with Microsoft SMTPSVC(6.0.2600.2180);
     Thu, 18 Oct 2007 00:55:31 +0600
Date: Wed, 17 Oct 2007 18:55:31 +0000
Subject: RSS- NEW registration
To: [email protected]
From:zico <[email protected]>
Reply-To:[email protected]
X-Mailer: PHP/5.2.1
X-Priority: 1
Return-Path: you@yourdomain
Message-ID: <MISU-7BE13ECFFF0usd00000001@misu-7be13ecfff>
X-OriginalArrivalTime: 17 Oct 2007 18:55:31.0484 (UTC) FILETIME=[4A992DC0:01C810EF]

Mail demo

--9B095B5ADSN=_01C810EED70A423600000001misu?7be13ecf ff--
----------------------------------------

and the bdr file show following message

Unable to deliver this message because the follow error was encountered: "This message is a delivery status notification that cannot be delivered.".

The specific error code was 0xC00402C7.


The message sender was <>.


The message was intended for the following recipients.
    you@yourdomain
------------------------------

i am using wamp server for php script
and configuration for php.ini file are
as follows

; For Win32 only.
SMTP = localhost
smtp_port=25
; For Win32 only.
sendmail_from = [email protected]
----------------------------------


thanks
rashed
 
Old November 8th, 2007, 10:03 AM
Registered User
 
Join Date: Nov 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to asanga
Default

hi
i have tested this in my web server it works fine. i haven't got any error. something wrong in your local host settings. do you have SMTP server in your local host?

try this one
;SMTP = localhost
SMTP = smtp.yourISP.com


Asanga Amarawansa
[email protected]
http://www.needmatch.biz





Similar Threads
Thread Thread Starter Forum Replies Last Post
mail sending in php lakshmi_annayappa BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 July 24th, 2008 09:15 AM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Problem with sending mail in php Paula222 Beginning PHP 4 July 16th, 2006 03:38 PM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.