LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-10-2004, 04:34 PM   #1
funkyche
LQ Newbie
 
Registered: Aug 2004
Location: Salt Lake City Utah
Distribution: Suse 9.1
Posts: 15

Rep: Reputation: 0
php and system mail


We are still kind of novices at Linux here. We set up a SLES 9 server to run a we b site. The web developer has created some scripts in php that will send mail to certain recipients. When he gets the email it is full of header junk that we need to take out.
My question is what program is php using to send out email? Can I edit the settings of this program, and if so, how do I do it? I would appreciate any help you could give me.

Thanks
 
Old 12-10-2004, 04:46 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
Hard to say without seeing the code that sends the mail. If it were me doing it, I'd be using the mail() function, which doesn't have any settings to adjust as far as the problem you're having really.

Last edited by sigsegv; 12-10-2004 at 04:57 PM.
 
Old 12-10-2004, 04:50 PM   #3
funkyche
LQ Newbie
 
Registered: Aug 2004
Location: Salt Lake City Utah
Distribution: Suse 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
This is what is contained in the php file:

<?php

$message = "<html><head></head><body>";
$message .= "<h1>Hello World!</h1>";
$message .= "</body></html>";

$recipient = "email@email.com";
$subject = "eNews Test";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-Type: text/html; charset=\"ISO-8859-1\"\r\n";
$headers .= "From: email@email.com\r\n";
// fetch subs table query results

mail($recipient, $subject, $message, $headers);
echo($message);


// free resources and close connection

?>


Does this help any? (i changed the email address on their because it was his private email)

Last edited by funkyche; 12-10-2004 at 04:52 PM.
 
Old 12-10-2004, 04:52 PM   #4
funkyche
LQ Newbie
 
Registered: Aug 2004
Location: Salt Lake City Utah
Distribution: Suse 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
Here is the header stuff we are recieving inside the body of the email.

From: email@email.com Message-Id: <20041209201228.81EBF1712C@webserver1.webgroup> Date: Thu, 9 Dec 2004 13:12:28 -0700 (MST) X-Nonspam: Whitelist
Hello World!
 
Old 12-10-2004, 05:03 PM   #5
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
I've seen the \r\n cause problems, and assuming it's hosted on a *NIX machine, only \n is needed. Try it with just \n and see if that fixes it.
 
Old 12-10-2004, 05:11 PM   #6
funkyche
LQ Newbie
 
Registered: Aug 2004
Location: Salt Lake City Utah
Distribution: Suse 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
I will, and I will let you know what happens. Thanks for your help!
 
Old 12-13-2004, 11:43 AM   #7
funkyche
LQ Newbie
 
Registered: Aug 2004
Location: Salt Lake City Utah
Distribution: Suse 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
That worked! Thanks again SigSegv!
 
  


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
PHP Website with e-mail forms, what mail daemon? gbkyle Linux - Software 1 07-05-2005 12:33 PM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 06:06 PM
php mass mail mus3ab Linux - Security 2 06-07-2004 01:38 AM
php + mail jogurt666 Programming 4 01-05-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:10 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