LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2006, 04:43 AM   #1
juancha
LQ Newbie
 
Registered: Feb 2006
Posts: 17

Rep: Reputation: 0
Email never arrives via my php script


Hi I'm quite strong in php but weak in Linux, I wrote a simple script to send an email.........as the script uses if/else statements I get a success message as if the mail reaches the outgoing mail service but each time I never receive the email...no matter what to: address I use or however many times I try.

I don't have root access to the box I'm developing on but my boss does.....he got into the mail logs and here's what he saw......

tms1:/var/spool/exim4/msglog# cat *

2006-02-21 18:47:54 Received from www-data@ U=www-data P=local S=438

2006-02-21 18:47:56 juan_chandler@hotmail.com R=dnslookup T=remote_smtp: SMTP error from remote mailer after MAIL FROM:<www-data@> SIZE=1471: host mx3.hotmail.com [65.54.244.72]: 501 Invalid Address

Process failed (1) when writing error message to www-data@ (frozen)tms1:/var/spool/exim4/msglog#

What does this mean?

I can telnet in on port 25 and send email at the command line.

here's the php script I wrote

<?php

//Declarate the necessary variables
$mail_to="juan_chandler@hotmail.com";
$mail_from="Juan@theinternetgroup.com";
$mail_sub="Emailing with php";
$mail_mesg="This is a test to see if I am able to email using php";

//Check for success/failure of delivery
if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from")){
echo "E-mail has been sent successfully to $mail_to";
}
else{
echo "Failed to send the E-mail from $mail_sub to $mail_to";
}
?>

Can anyone help please?
 
Old 02-22-2006, 05:21 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from")){
That one maybe? It's usually backslash-r backslash-n.
 
Old 02-22-2006, 05:37 AM   #3
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
So \r\n, not /r/n
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you config postfix to redirect incoming email to a php script genux33 Linux - General 0 12-14-2005 03:46 AM
issues with mirc script accessing our php script dtra Linux - Software 2 07-02-2005 04:30 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
converting shell script to php script ? ibro Linux - General 6 05-24-2004 05:19 AM
The FNG arrives BlenderGuy Linux - Newbie 6 03-02-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration