Computing.Net > Forums > Programming > PHP Mail()-function- all on 1 line?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP Mail()-function- all on 1 line?

Reply to Message Icon

Name: Johanovitch
Date: January 13, 2003 at 14:24:20 Pacific
OS: SuSE 7.2
CPU/Ram: 366MHz/64MB
Comment:

Hi, I'm having a little problem.
I have a form (in flash) which calls this code in a php-page:

$subject = "My subject";
$contactname = "my name";
$contactemail = "my@email.adres";
$message = "my message";

$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$realname." \r\n";
$headers .= "To: ".$contactname." \r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: my.domain";
mail($contactemail, $subject, $message, $headers);


When I use the form, everything works, but everything is on 1 line, which makes it hard to read.
Is there faulty code?
What am I doing wrong?
any help apreciated!

I noticed that when I add an extra variable to the mail()-function, that I recieve the email, but from "Daemon user for apache" instead of the emailadres filled-in in the form. But the strange thing is that when I do that, that the text appears as I want it, including the linebreaks. But then there is an error in the emailheader, he then doesn't understand "MIME-Version 1.0"

any ideas?



Sponsored Link
Ads by Google

Response Number 1
Name: Me
Date: January 14, 2003 at 11:11:35 Pacific
Reply:

You may have uploaded it in Auto mode, you have to upload all your scripts in ASCII mode, you can prefer this setting in your upload manager. The wrong sender name is because of your server, contact your hosting company for any details.


0

Response Number 2
Name: Johanovitch
Date: January 15, 2003 at 08:36:54 Pacific
Reply:

I uploaded it in ascii mode. The wrong sender name appears only if I add an extra option to the mail()-funtion. If I use the script that you see in the first post, the sender name is correct. So I guess that is caused by the fact that it doesn't understand the extra option in the mail function.

But why does it work (almost) if I use mail()wrongly and doesn't work correct when I use it as posted above?

(by the way, it's my own server, so I can change anything if that would appear to be necessary)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PHP Mail()-function- all on 1 line?

Perl (or PHP) mail function www.computing.net/answers/programming/perl-or-php-mail-function/14685.html

find large files recursive bash www.computing.net/answers/programming/find-large-files-recursive-bash/14357.html

Batch file. Extract single phrase f www.computing.net/answers/programming/batch-file-extract-single-phrase-f/16419.html