Ask a Question related to PHP Development, Design and Development.
-
James M. Luongo #1
mail() problems, how do I print out what the error is?
Hello,
I am having problems with the mail() function, but I don't know what the
problems are.
Here is a snippet of code:
$to = "jmluongo@comcast.net";
$from = "Gallery@gafok.com";
$subject = "Gallery Comment";
$msg = "You have received a comment from " . $commenter_name;
$msg .= "\n\nAt index: " . $index;
$msg .= "\n\nIP address: " . $IPNumber;
$msg .= "\n\nComment: " . stripslashes($comment_text);
mail($to, $subject, $msg, "$from") or print "Cannot send mail \n";
I keep getting the "Cannot send mail" message and I want to see why. Is
there any way to see what the error really is?
thanks,
_James Luongo
James M. Luongo Guest
-
Print Multiple Mail App Emails as One PDF
I'm pretty late to the topic but am having the same issue like Keith. Using the latest Mail.app i need to compile roughly 1900 emails that are... -
e-Mail Problems
A .pdf document was created using InDesign CS. When the .pdf document was e-mailed to two individuals one was able to open and print the document but... -
Postscript Print error (ERROR: rangecheck; OFFENDING COMMAND: filter)
We are attempting to print off some rather large image files on a Xerox 340 and an HP Laserjet 4MV printer via Adobe Acrobat 6. Smaller similar files... -
PHP Mail Problems
BillyJoe wrote: I believe the From: needs a real existing email adress. -
Problems with mail()
Im having a formatting issue with mail(). My simple script looks like: $key = blah@blah.com; $subject = "My membership"; $message_to_send =... -
Spidah #2
Re: mail() problems, how do I print out what the error is?
Check the [Mail Function] section of your php.ini file and make sure the
path to your mail server is correct.
Hamilton
[url]www.laughland.biz[/url]
"the web site for web sites"
"James M. Luongo" <jmluongo@nospam.comcast.net> wrote in message
news:3F0CAF93.4080506@nospam.comcast.net...> You are correct about the From: field, but that didn't solve the
> problem. It's still not sending the mail and I wish to find out what
> the error code or message is.
>
> -James
>
> Joshua Ghiloni wrote:
>>> > James M. Luongo wrote:
> >> > Your From: header is wrong. Read up on the RFC or omit it. I do believe> >> Hello,
> >>
> >> I am having problems with the mail() function, but I don't know what
> >> the problems are.
> >>
> >> Here is a snippet of code:
> >>
> >> $to = "jmluongo@comcast.net";
> >> $from = "Gallery@gafok.com";
> >> $subject = "Gallery Comment";
> >> $msg = "You have received a comment from " . $commenter_name;
> >> $msg .= "\n\nAt index: " . $index;
> >> $msg .= "\n\nIP address: " . $IPNumber;
> >> $msg .= "\n\nComment: " . stripslashes($comment_text);
> >> mail($to, $subject, $msg, "$from") or print "Cannot send mail \n";
> >>
> >> I keep getting the "Cannot send mail" message and I want to see why.
> >> Is there any way to see what the error really is?
> >>
> >> thanks,
> >>
> >> _James Luongo
> >>
> > that your From header should look like (untested)
> >
> > $from = "From: [email]Gallery@gafok.com[/email]\r\n";
> >
Spidah Guest
-
Jon Kraft #3
Re: mail() problems, how do I print out what the error is?
"James M. Luongo" <jmluongo@nospam.comcast.net> wrote:
Hi James,> I am having problems with the mail() function, but I don't know what the
> problems are.
>
> Here is a snippet of code:
>
> $to = "jmluongo@comcast.net";
> $from = "Gallery@gafok.com";
> $subject = "Gallery Comment";
> $msg = "You have received a comment from " . $commenter_name;
> $msg .= "\n\nAt index: " . $index;
> $msg .= "\n\nIP address: " . $IPNumber;
> $msg .= "\n\nComment: " . stripslashes($comment_text);
> mail($to, $subject, $msg, "$from") or print "Cannot send mail \n";
The correct From header would be (and don't forget \r\n):
$from = "From: [email]Gallery@gafok.com[/email]\r\n";
// ..
mail($to, $subject, $msg, $from) or print "Cannot send mail \n";
If you are on Linux/Unix, check the path to sendmail in php.ini - on
Windows make sure you've set the SMTP server entry in php.ini to a valid
SMTP server.
HTH;
JOn
Jon Kraft Guest
-
Richard Hockey #4
Re: mail() problems, how do I print out what the error is?
I'd recommend checking php.ini to see if php is writing an error log file.
If it is, check in the error log, there may be more information on the
problem in there.
"James M. Luongo" <jmluongo@nospam.comcast.net> wrote in message
news:3F0C9C3B.60404@nospam.comcast.net...> Hello,
>
> I am having problems with the mail() function, but I don't know what the
> problems are.
>
> Here is a snippet of code:
>
> $to = "jmluongo@comcast.net";
> $from = "Gallery@gafok.com";
> $subject = "Gallery Comment";
> $msg = "You have received a comment from " . $commenter_name;
> $msg .= "\n\nAt index: " . $index;
> $msg .= "\n\nIP address: " . $IPNumber;
> $msg .= "\n\nComment: " . stripslashes($comment_text);
> mail($to, $subject, $msg, "$from") or print "Cannot send mail \n";
>
> I keep getting the "Cannot send mail" message and I want to see why. Is
> there any way to see what the error really is?
>
> thanks,
>
> _James Luongo
>
Richard Hockey Guest



Reply With Quote

