Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems sending email through php

Status
Not open for further replies.

s0crates9

Technical User
Jun 18, 2005
70
US
Using php's mail() function on a certain server, I am getting no mail sent.

I tried running a simple mail script and also by command line to get no emails sent. I have tried the same mail() command on another server and it works fine, as a matter of fact, there is another virtual site on the same server I am having problems with that does work.

So this is quite confusing and there is no associated error on the page.

Anyone have a clue what this could be?

Business Identity and Web Development Services
 
What is your PHP run environment?
What version are you running?
On what platform?
Are you running PHP with a web server?
If so, what web browser?
If so, are you running PHP as
a module in the server or
as a CGI?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Sorry I didn't include this information:

Running PHP 4.3.10 on a Freebsd 4.11 Server running apache 1.3.33.

PHP is being run as a module in apache. I am using IE/Firefox.



Business Identity and Web Development Services
 
By default, PHP on a Unix-like OS will use the local mail daemon. Is your local mail delivery daemon operating correctly?

Can you please post a script snipped that shows your mail() invocation?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
This is what I am using in the mail function:

Code:
if(mail("info@mysite.net","Test Subject","This is a test message","MIME-Version: 1.0 \r\nContent-type: text/html; charset=iso-8859-1 \r\nTo: Sam, Ann<info@mysite.net>\r\nFrom: Web Department<mysept@mysite.net>\r\nBcc:admin@mysite.net")){
echo "An e-mail was sent.";
}else{
echo "There was a problem sending the mail. Check your code and make sure that the e-mail address is valid";
}

It works on my windows test server...

Business Identity and Web Development Services
 
Seperate headers with \n rather than \r\n.




--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
I figured it out. I wanted to thank you guys for helping though!

All it was ended up being the to and from sections. Here is the before:
Code:
To: Sam, Ann<info@mysite.net>\r\nFrom: Web Department<mysept@mysite.net>

And here is the fixed code:
Code:
To: "Sam, Ann"<info@mysite.net>\nFrom: "Web Department"<mysept@mysite.net>

Much thanks guys for your assistance!

Web site design, internet marketing, SEO and business solutions company.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top