f



MS-Windows mail servers and PHP's mail() function

I have a contact form that uses PHP's mail() function.  It recently
came to my attention that (some?) MS-Windows mail servers may not
properly process data given to the mail() function that's only
newline-terminated.

The mail() function takes up to five parameters:

    mail(recipient, subject, message, [headers [,parameters]])

The ones of interest here are the first four.  The questions are
these:

    1. Since recipient and subject are not multi-line, and, from the
       web form, don't even contain newlines, is it safe to assume
       they need neither newlines nor carriage-returns?

    2. The message, from the web form, contains newlines.  I assume
       all newlines need carriage-returns inserted in front of them?

    3. The headers are created, in the web form processing, by
       appending newline-terminated strings to a variable (e.g.:
       headers .= "blah: yadda\n";).  I presume that this string
       likewise needs carriage-returns inserted before the newlines?

    4. I've seen mention of problems with "hanging carriage-returns."
       I presume that simply means there should be no line, blank or
       otherwise, that contains a carriage-return w/o an accompanying
       newline?

Assuming all the above to be true, my four parameters would look like:

    recipient: "somebody@example.com"
      subject: "Some subject"
      message: "Some message\r\ntext\r\ngoes here\r\n"
      headers: "Header1: foo\r\nHeader2: bar\r\nHeader3: baz\r\n"

Is the above what (some?) MS-Windows mail servers want to see?

TIA,
Jim
-- 
Jim Seymour                    | PGP Public Key available at:
                               | http://www.uk.pgp.net/pgpnet/pks-commands.html
                               |
                               | http://jimsun.LinxNet.com
0
jseymour (27)
7/24/2004 3:17:03 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

7 Replies
1725 Views

Similar Articles

[PageSpeed] 31

Jim Seymour wrote:
> I have a contact form that uses PHP's mail() function.  It recently
> came to my attention that (some?) MS-Windows mail servers may not
> properly process data given to the mail() function that's only
> newline-terminated.
> 
> The mail() function takes up to five parameters:
> 
>     mail(recipient, subject, message, [headers [,parameters]])
> 
> The ones of interest here are the first four.  The questions are
> these:
> 
>     1. Since recipient and subject are not multi-line, and, from the
>        web form, don't even contain newlines, is it safe to assume
>        they need neither newlines nor carriage-returns?
> 
>     2. The message, from the web form, contains newlines.  I assume
>        all newlines need carriage-returns inserted in front of them?
> 
>     3. The headers are created, in the web form processing, by
>        appending newline-terminated strings to a variable (e.g.:
>        headers .= "blah: yadda\n";).  I presume that this string
>        likewise needs carriage-returns inserted before the newlines?
> 
>     4. I've seen mention of problems with "hanging carriage-returns."
>        I presume that simply means there should be no line, blank or
>        otherwise, that contains a carriage-return w/o an accompanying
>        newline?
> 
> Assuming all the above to be true, my four parameters would look like:
> 
>     recipient: "somebody@example.com"
>       subject: "Some subject"
>       message: "Some message\r\ntext\r\ngoes here\r\n"
>       headers: "Header1: foo\r\nHeader2: bar\r\nHeader3: baz\r\n"
> 
> Is the above what (some?) MS-Windows mail servers want to see?
> 
> TIA,
> Jim

it is not just "MS-Windows" mail servers, the CR/LF is a part of the SMTP RFC 
for email headers. There have been several discussions in this group about this 
issue in the past, rather trying to remember all of the nuances of the 
discussions, I would recommend a search for WNT, PHP, mail and take a look at 
the docs.

-- 
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
0
maustin (1437)
7/24/2004 3:45:12 PM
In article <cuvMc.5218$MS2.2457@newssvr22.news.prodigy.com>,
	Michael Austin <maustin@firstdbasource.com> writes:
[snip]
> 
> it is not just "MS-Windows" mail servers, the CR/LF is a part of the
> SMTP RFC 
> for email headers.

I'm aware of that.  But my mail servers, at least, seem to just
"handle it" when I use the mail() function.  (Which injects email
into the local MTA's queue via the "sendmail" command and therefor
isn't using SMTP, btw.)  I don't know that *all* 'nix-based MTAs do
that, but mine does.  Furthermore: From my discussion with my friend
and colleague: Apparently so do some (most?) MS-Win-based MTAs.  He
has a .NET-based contact form that was working just fine, until along
came somebody for whom it did not work (mail simply went into a black
hole - no error return or anything) until he inserted
carriage-returns.

>                    There have been several discussions in this group
> about this 
> issue in the past, rather trying to remember all of the nuances of the 
> discussions,

I searched my current news spool for "[Ww]indows.*[Mm]ail" and
"[Mm]ail.*[Ww]indows", w/o success.

>              I would recommend a search for WNT, PHP, mail

Okay.  I'll try those search terms in Google Groups.  Thanks.

>                                                            and take a
> look at 
> the docs.

I looked at the docs.  My questions were based on what I gleaned from
the docs and the associated follow-up comments.  I'm just trying to
make sure, as best as possible, I have it as right, since I have no
MS-Win server to test it on and no idea what MS-Win-based MTA(s) need
the carriage-returns, even if I did.

Thanks for the follow-up.

-- 
Jim Seymour                    | PGP Public Key available at:
WARNING: The "From:" address   | http://www.uk.pgp.net/pgpnet/pks-commands.html
is a spam trap.  DON'T USE IT! |
Use: jseymour@LinxNet.com      | http://jimsun.LinxNet.com
0
jseymour (27)
7/24/2004 4:13:05 PM
Hello,

On 07/24/2004 01:13 PM, Jim Seymour wrote:
> I looked at the docs.  My questions were based on what I gleaned from
> the docs and the associated follow-up comments.  I'm just trying to
> make sure, as best as possible, I have it as right, since I have no
> MS-Win server to test it on and no idea what MS-Win-based MTA(s) need
> the carriage-returns, even if I did.

Depending on the PHP version that you use, your deliveries may be 
affected by bugs of the PHP mail() function.

You may want to try this class that provides some workarounds to the PHP 
mail function bugs. It comes with several sub-classes that implement 
alternative delivery methods to using the mail function. It also comes 
with wrapper functions named smtp_mail() and sendmail_mail() functions 
that emulate the mail() function except that they deliver the messages 
via the sendmail program or via SMTP.

http://www.phpclasses.org/mimemail


-- 

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
0
mlemos (662)
7/24/2004 11:42:19 PM
Hello,

On 07/24/2004 01:13 PM, Jim Seymour wrote:
> I looked at the docs.  My questions were based on what I gleaned from
> the docs and the associated follow-up comments.  I'm just trying to
> make sure, as best as possible, I have it as right, since I have no
> MS-Win server to test it on and no idea what MS-Win-based MTA(s) need
> the carriage-returns, even if I did.

Depending on the PHP version that you use, your deliveries may be 
affected by bugs of the PHP mail() function.

You may want to try this class that provides some workarounds to the PHP 
mail function bugs. It comes with several sub-classes that implement 
alternative delivery methods to using the mail function. It also comes 
with wrapper functions named smtp_mail() and sendmail_mail() functions 
that emulate the mail() function except that they deliver the messages 
via the sendmail program or via SMTP.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
0
mlemos (662)
7/24/2004 11:42:35 PM
In article <4102F3DB.4050009@acm.org>,
	Manuel Lemos <mlemos@acm.org> writes:
> Hello,
> 
> On 07/24/2004 01:13 PM, Jim Seymour wrote:
>> I looked at the docs.  My questions were based on what I gleaned from
>> the docs and the associated follow-up comments.  I'm just trying to
>> make sure, as best as possible, I have it as right, since I have no
>> MS-Win server to test it on and no idea what MS-Win-based MTA(s) need
>> the carriage-returns, even if I did.
> 
> Depending on the PHP version that you use, your deliveries may be 
> affected by bugs of the PHP mail() function.

I've used the code I wrote under everything from PHP 4.2.3 to 4.3.8,
with Apache from at least 1.3.27 through 1.3.31, on various releases
of Linux, Sparc Solaris and FreeBSD, with sendmail, qmail, and various
revisions of Postfix for MTAs.

> 
> You may want to try this class that provides some workarounds to the PHP 
> mail function bugs.
[snip]
> 

Thanks, Manuel, but good ol' mail() is working fine for me, on the
platforms I choose to use.  If mail() was so b0rk3d as to fail to
work correctly and reliably on my platforms-of-choice, I wouldn't be
using PHP.  Period.  If I can do *minor* code-changes to make my work
(more) usable by my MS-Win-using brethren: I'm more than happy to do
so.  But *minor* is as far as I'm willing to go.

Thanks for the follow-up.

-- 
Jim Seymour                    | PGP Public Key available at:
WARNING: The "From:" address   | http://www.uk.pgp.net/pgpnet/pks-commands.html
is a spam trap.  DON'T USE IT! |
Use: jseymour@LinxNet.com      | http://jimsun.LinxNet.com
0
jseymour (27)
7/25/2004 4:56:21 AM
In article <cuvMc.5218$MS2.2457@newssvr22.news.prodigy.com>,
	Michael Austin <maustin@firstdbasource.com> writes:
> Jim Seymour wrote:
>> I have a contact form that uses PHP's mail() function.  It recently
>> came to my attention that (some?) MS-Windows mail servers may not
>> properly process data given to the mail() function that's only
>> newline-terminated.
[snip]
> 
> it is not just "MS-Windows" mail servers, the CR/LF is a part of the
> SMTP RFC 
> for email headers. There have been several discussions in this group
> about this 
> issue in the past, rather trying to remember all of the nuances of the 
> discussions, I would recommend a search for WNT, PHP, mail and take a
> look at 
> the docs.

Unfortunately, I wasn't able to turn up much in the way of useful
information by searching Google Groups with strings such as "WNT
mail," "WINNT mail," or "WIN32 mail."  But this URL

    http://us2.php.net/manual/en/function.mail.php

had, on a second reading, all that I needed.  (I think.)  From that,
it looks like all I have to do is make sure the additional_headers
have cr/lf at the end of each header line, save the last header line,
which must have neither a cr nor a lf.

My additional_headers are added here-and-there, throughout the code,
to a variable named $addlHeaders.  Each header line is added with a
trailing newline.  So, just before I call mail, I have this bit of
code:

    // MS-Win mail servers want crlf and *don't* want a trailing pair
    if(PHP_OS == "WIN32" || PHP_OS == "WINNT") {
	// It seems we only need do this with the "additional headers,"
	// but we're set up here to easily add other mail() variables.
	foreach (array('addlHeaders') as $foo) {
	    $$foo = preg_replace("/\n$/", "", $$foo);
	    $$foo = preg_replace("/\n/", "\r\n", $$foo);
	}
    }

Thanks to all for the follow-ups.

-- 
Jim Seymour                    | PGP Public Key available at:
WARNING: The "From:" address   | http://www.uk.pgp.net/pgpnet/pks-commands.html
is a spam trap.  DON'T USE IT! |
Use: jseymour@LinxNet.com      | http://jimsun.LinxNet.com
0
jseymour (27)
7/25/2004 8:00:14 PM
simply put, use PHPMailer. ever since replacing all of PHPs crappy mail() 
with PHPMailer, i have never had a single problem.

"Jim Seymour" <jseymour@LinxNet.com> wrote in message 
news:10g4vbfnvbvt92d@corp.supernews.com...
>I have a contact form that uses PHP's mail() function.  It recently
> came to my attention that (some?) MS-Windows mail servers may not
> properly process data given to the mail() function that's only
> newline-terminated.
>
> The mail() function takes up to five parameters:
>
>    mail(recipient, subject, message, [headers [,parameters]])
>
> The ones of interest here are the first four.  The questions are
> these:
>
>    1. Since recipient and subject are not multi-line, and, from the
>       web form, don't even contain newlines, is it safe to assume
>       they need neither newlines nor carriage-returns?
>
>    2. The message, from the web form, contains newlines.  I assume
>       all newlines need carriage-returns inserted in front of them?
>
>    3. The headers are created, in the web form processing, by
>       appending newline-terminated strings to a variable (e.g.:
>       headers .= "blah: yadda\n";).  I presume that this string
>       likewise needs carriage-returns inserted before the newlines?
>
>    4. I've seen mention of problems with "hanging carriage-returns."
>       I presume that simply means there should be no line, blank or
>       otherwise, that contains a carriage-return w/o an accompanying
>       newline?
>
> Assuming all the above to be true, my four parameters would look like:
>
>    recipient: "somebody@example.com"
>      subject: "Some subject"
>      message: "Some message\r\ntext\r\ngoes here\r\n"
>      headers: "Header1: foo\r\nHeader2: bar\r\nHeader3: baz\r\n"
>
> Is the above what (some?) MS-Windows mail servers want to see?
>
> TIA,
> Jim
> -- 
> Jim Seymour                    | PGP Public Key available at:
>                               | 
> http://www.uk.pgp.net/pgpnet/pks-commands.html
>                               |
>                               | http://jimsun.LinxNet.com 


0
stinky (50)
7/25/2004 10:15:11 PM
Reply:

Similar Artilces:

when receiving the mail(php mail function), the variable's last value is getting converted to $ or # replacing the digit
Below is my code: But when I receive the mail, I don't get the last two digits in the $post_url. I tried displaying the same message on the page and it displayes $post_url properly. But when I receive the mail, I get the value of $post_url as www.32minutesforum.com/post_clicked.php?id$. where as I should get www.32minutesforum.com/post_clicked.php?id<some number>. i.e. www.32minutesforum.com/post_clicked.php?id15 Please help! File: <?php include 'connect.php'; include 'header.php'; echo '<div class="holder_content">'; echo '<section class="group_text">'; echo 'Posted successfully. Check your post <a href="'.$_SESSION['reply_post_id'].'">HERE</a>'; $post_url = $_SESSION['reply_post_id']; $to= $_SESSION['post_email']; $subject="You just got a reply for your post in 32minutesforum.com"; $message=' <html> <head> <title>32 Minutes Forum</title> </head> <body> <p>You got a reply for your post title: '. $_SESSION['post_title'].'.</p> <p>Check your post in:<br/>www.32minutesforum.com/'.$post_url.'.</p> <p>Thanks for using 32minutesforum.com.<br/> Thank you,<br/> 32minutesforum.com Team.</p> </body> </html>'; ...

php's mail() function // permission problems
Hi all. I'm trying to get php's mail() function working. When I use it at the moment, I get: /var/log/messages: Jul 14 13:23:27 mail sendmail[22171]: NOQUEUE: Milter (mimedefang): to error state /usr/local/apache2/logs/error_log: Program mode requires special privileges, e.g., root or TrustedUser. I have checked in the PHP newsgroups, and they assure me it is a problem with my sendmail setup... I have installed sendmail (8.12.8) as per included instructions and read the SECURITY file. The following permissions set: -r-xr-sr-x 1 root smmsp 611974 Mar 5 21:37 /usr/sbin/sendmail in /var/spool: drwxrwx--- 2 smmsp smmsp 1264 May 13 12:00 clientmqueue drwx------ 2 root wheel 48 Jul 14 13:00 mqueue in /etc: -r--r--r-- 1 root wheel 55847 Jun 17 12:25 sendmail.cf -r--r--r-- 1 root wheel 55847 Jun 17 12:25 submit.cf What else should I be checking? Thanks in advance! Dan -- Daniel Kasak IT Developer * NUS Consulting Group* Level 18, 168 Walker Street North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dkasak@nusconsulting.com.au website: www.nusconsulting.com On Mon, 14 Jul 2003, Daniel Kasak wrote: > I'm trying to get php's mail() function working. When I use it at the > moment, I get: > > /var/log/messages: > Jul 14 13:23:27 mail sendmail[22171]: NOQUEUE: Milter (mimedefang): to > error state > > /usr/local/apache2/logs/error_...

PHP mail() function failing to send mail
Hi everyone, Our setup: PHP 4.3.11, FreeBSD 5.3 RELEASE, Sendmail 8.1, 1 host environment, 2 jails. Our problem: While we can send email from the command line just fine in one of the jails, we cannot use the php mail() command to send email using sendmail at all. The function, when executed, does absolutely nothing. No error, no reports to the maillog, nothing. I've read somewhere that it's "not possible" to send mail using the php mail() function within a freebsd jail, but i'm nearly certain we have it working this way on another server, but can't seem to figure out the issue. Anyone know any tests we can do to learn more? Thanks. Check out the log messages from your sendmail... If it's not logging anything, try increasing (temporarily) the log level (24 should be more than enough) Probability says that you're running into a permission issue with sendmail. Probably your PHP/Apache user is not allowed to relay email. I'm not sure this might apply since I am not familiar to BSD, but, had similar problems with a RH machine just a few days ago ...

Enable Mail function for PHP under Windows XP
Hello, I have installed Apache2.0 and PHP4.3 on my PC under Windows XP. What are the different steps to make the mail function work. I think I have to install first a mail server, but I don't know where to find one that is relatively 'easy' to install and configure. Any help on the subject will be greatly aprecheated. Thank you. "JB" <jeanbaptiste_isnardon@yahoo.fr> a �crit dans le message news: 477bc493.0406210457.4e24d6c8@posting.google.com... > Hello, > > I have installed Apache2.0 and PHP4.3 on my PC under Windows XP. > What are the different steps to make the mail function work. > I think I have to install first a mail server, but I don't know where > to find one that is relatively 'easy' to install and configure. > > Any help on the subject will be greatly aprecheated. > > Thank you. in php.ini file find line with the keyword smtp SMTP = your_internet_service_provider_smtp_server_address ex : [mail function] ; For Win32 only. SMTP = smtp.your_internet_service_provider.com -- paul jeanbaptiste_isnardon@yahoo.fr (JB) wrote in message news:<477bc493.0406210457.4e24d6c8@posting.google.com>... > Hello, > > I have installed Apache2.0 and PHP4.3 on my PC under Windows XP. > What are the different steps to make the mail function work. > I think I have to install first a mail server, but I don't know where > to find one that is relatively 'easy' to install and co...

How to find Mail server and sender's mail id automatically ?
Hello there How can I automatically detect mail server confiured on local machine by programmtically ? Is there any way to find out mail server ! As well as I want to find the mail address of sender automatically ( whihc is configured for MS Outlook) My aim is to send mail using one component. But I just don't want to ask user to type mail server and his mail id ( From : --- ). My program would automate this job, choose correct mail server and send the mail. On 27 Feb 2005 23:12:52 -0800, ajay.sonawane@gmail.com wrote: >Hello there >How can I automatically detect mail ...

Finding the user's ISP's outgoing mail server?
Hi folks I'm adding email functionality to a software application. Each user is known to be "connected to the internet", but they do not necessarily have an email client on their PC. So I'm planning to add an SMTP component to the application, to send the email directly to the outgoing mailserver of the user's ISP. So it's the old question: how do I identify that mailserver, through code? Here's my plan. AFAIK, most (all?) ISPs give their users an email address. What if I ask the user to enter that email address, and then I do an MX query on the domain of that ...

Adding additional cc to PEAR's mail.php
I have the following code, I can send e-mail to:, cc:, and bcc:, but what if I want to add another cc? I'm using PEAR's Mail.php. $hdrs['From']= $From; $hdrs['To']= $To; $hdrs['Subject']= $Subject; $recipients = $To.", ". $Cc.", ". $Bcc; Thanks, --TJ On Tue, 04 Mar 2008 21:42:04 +0100, techjohnny@gmail.com = <techjohnny@gmail.com> wrote: > I have the following code, I can send e-mail to:, cc:, and bcc:, but > what if I want to add another cc? I'm using PEAR's Mail.php. > > > $hdrs['From']=3D $From; > $hdrs['To']=3D $To; > $hdrs['Subject']=3D $Subject; > > $recipients =3D $To.", ". $Cc.", ". $Bcc; See the comment of arminfrey at = <http://pear.php.net/manual/en/package.mail.mail.send.php>. Haven't test= ed = it (I normally have no use for PEAR MAIL, but it seems to be your answer= .... -- = Rik Wasmus ...

PHP mailing and windows
I'm looking at code from an Open Source project and trying to run it on Windows XP. However, it seems that the mail function does not work. $success=@mail( $u, $subject, $content, "From: " . $from . "\r\n" . "Content-type: text/html"); Is there anything I should know? FULL CODE: <?php $title = 'Notify Students'; require_once('dbcode.php'); require('./includes/template_top.php'); db_connect(); required_param($survey_id, 'survey_id'); required_param($who_to_mail, 'who_to_mail'); required_param($from, 'from'); required_param($subject, 'subject'); required_param($body, 'body'); if(strstr($body, '[LINK]') == FALSE) { exit('Your body must contain the [LINK] text to provide a URL. Please go back and add it and try again'); } $url_base = $host . "/take_survey.php?survey_id=$survey_id"; // Set the incomplete flag to zero mssql_query("update Surveys set Incomplete = 0 where SurveyId=$survey_id"); $survey_info = mssql_query_array("select * from Surveys where SurveyId=$survey_id"); $owner = $faculty_login_info['Name']; $deadline = $survey_info['Deadline']; $title = $survey_info['Title']; $users=mssql_query("select * from SurveyPermissions where SurveyId=$survey_id"); ini_set('SMTP',$smtp_server); ini_set('sendmail_from', $from); while($user=mssql_fet...

php mail function
i have set up a feedback form that emails the results. my web host says it will not work if the email is coming from nobody. this is their answer "you are just going to have to learn to tell your scripts to generate th emails as someone@yourdmain - not just as nobody." does anyone know how to make this happen? Quinonez wrote: > i have set up a feedback form that emails the results. my web host > says it will not work if the email is coming from nobody. this is > their answer "you are just going to have to learn to tell your > scripts to generate th emails as someone@yourdmain - not just as > nobody." > does anyone know how to make this happen? By using the fourth argument of the mail() function to send a "From: someone@yourdomain" header. See: http://www.php.net/manual/en/function.mail.php JW how would i set this up? On 17 Dec 2004 08:15:54 -0800, Quinonez <quinonez@gmail.com> wrote: > how would i set this up? > Nothing to set up, just include the from argument: mail('to email', 'subject', 'message', 'From: yourstruly@yourdomain.com'); -- Thomas SELECT date FROM wife WHERE bitching = '0' AND sex = '1' ive set this up like so <? mail("quinonez@gmail.com", "subject", "my message", "From: webmaster@masterscommissioneurope.com\r\n"); ?> but im still not recieving the emails..... the host says its because...

php mail() not sending to mail Clients (ie, Outlook, Apple Mail, thunderbird, etc..)
I have a send mail script on my site that. The emails are recieved by gmail, and yahoo, but not to mail clients like Outlook, Mail, etc...) Is this a problem with the script, or is it something I must change in php ini file? Thanks in advance for any help. here is the code. (im using it in conjunction with javascript for some AJAX stuff) if(!isset($_GET['action'])) { die("You must not access this page directly!"); //Just to stop people from visiting contact.php normally } /* Now lets trim up the input before sending it */ $name = trim($_GET['name']); //The senders name $to = trim($_GET['maily']); //The senders email address $place = trim($_GET['place']); //The senders email address $subject = "you have recieved mail"; $headers = "From:$name"; $message = "{$name} deemed you worthy of receiving the following information/exchange from Trumpet.\n\n Follow This Link {$place}"; mail($to, $subject, $message,$headers); //a very simple send echo 'contactarea|<p class="sent">Article Sent!</p>'; //now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update. ?> shybe wrote: > I have a send mail script on my site that. > > The emails are recieved by gmail, and yahoo, but not to mail clients > like Outlook, Mail, etc...) > > Is this a problem with the script, or is it something ...

$_SERVER['SCRIPT_FILENAME'] = '/php/php.exe'???
Hi, I am trying to use script filename to give me the entire path and filename of the current page. For some reason though it is giving me the value of '/php/php.exe'. Why might this be? In my Apache http.conf file I do have the line: Action application/x-httpd-php "/php/php.exe" Might this have something to do with it? Cheers Burnsy bissatch@yahoo.co.uk wrote: > Hi, > > I am trying to use script filename to give me the entire path and > filename of the current page. For some reason though it is giving me > the value of '/php/php.exe'. Why might this be? AFAIK, to get the entire path + filename (from the point of view of the filesystem, not the webserver) of the current script you can use the predefined constant __FILE__. JP -- Sorry, <devnull@cauce.org> is a spam trap. Real e-mail address unavailable. 5000+ spams per month. ...

Is Php built in function ' imagecreate()' compatible in Php version 5.2.2 ?
Hi All, I have the php version 5.2.2 . When I am using " $im = imagecreate(......); " I am getting the following message "Fatal error: Call to undefined function imagecreate() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\server.php on line 32" I want to know whether "imagecreate()" is compatible in PHP version 5.2.2.? saikiran.iitkgp@gmail.com wrote: > Hi All, > > I have the php version 5.2.2 . When I am using > > > " $im = imagecreate(......); " I am getting the following message > > > "Fatal error: Call to undefined function imagecreate() in C:\Program > Files\Apache Software Foundation\Apache2.2\htdocs\server.php on line > 32" > > > I want to know whether "imagecreate()" is compatible in PHP version > 5.2.2.? > It looks like you're missing the gd extension. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== edit php.ini ;extension=php_gd2.dll to extension=php_gd2.dll ...

Sorting algorithm(s) used by PHP's sort function
Does anyone know what sorting algorithm(s) -- quicksort, mergesort, radix sort, etc. -- does PHP use internally in its sort function? "Shaunak Kashyap" <skashyap@intertechmedia.com> wrote in message news:67746bb.0307241733.63a5649f@posting.google.com... > Does anyone know what sorting algorithm(s) -- quicksort, mergesort, > radix sort, etc. -- does PHP use internally in its sort function? There's a lot of sorting algorithms used by PHP. It looks like the primary array sorting method is quicksort. I also found some use of mergesort. Looking at the source, I found this: <builddirectory>/ext/standard/array.c This sets up the "hooks" for most of the array functions for use in Zend. It looks like all of the sort methods rely on a sort_type == zend_qsort. Doing a quick search for this in the rest of the source, returns this: <builddirectory>/Zend/zend_qsort.c If you look at this file, you can see the good ol' quick sort algorithm in action. If you prefer a different algorithm, I'm sure you could replace the quicksort algorithm, recompile PHP, and whammo! If you're interested in developing extensions to PHP, the API is pretty well documented in the manual and in "Programming PHP" by Rasmus Lerdorf. I wish I had the time to tinker with PHP at this level. Take care, Zac ...

Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')
I installed PEAR HTTP_Upload to my new server and now im getting this error when runnign the script. any help? Maximus wrote: > I installed PEAR HTTP_Upload to my new server > and now im getting this error when runnign the script. > > > any help? > permissions problem? where is DB.php located? does DB.php reside in the include_path directories? The message is self explanatory. -- Michael Austin. DBA Consultant Donations welcomed. Http://www.firstdbasource.com/donations.html :) Try on your command line as root: >pear install DB Alex http://prepared-statement.blogspot.com ...

I installed PHP from an RPM, but Apache isn't processing the PHP pages! What's going on here?
=============================================================================== I installed PHP from an RPM, but Apache isn't processing the PHP pages! What's going on here? Somebody can help me ? If I do /usr/sbin/apachectl extendedstatus command, I got this. =============================================================================== * * * Apache Server Status for noname.com Server Version: Apache-AdvancedExtranetServer/2.0.44 (Mandrake Linux/11mdk) mod_perl/1.99_08 Perl/v5.8.0 mod_ssl/2.0.44 OpenSSL/0.9.7a PHP/4.3.1 Server Built: Mar 4 2003 21:21:03 _________________________________________________________________ Current Time: dimanche, 21-sep-2003 21:56:22 EDT Restart Time: dimanche, 21-sep-2003 19:13:15 EDT Parent Server Generation: 0 Server uptime: 2 hours 43 minutes 6 seconds 1 requests currently being processed, 5 idle workers __W___.......................................................... ................................................................. ................................................................. ................................................................. Scoreboard Key: "_" Waiting for Connection, "S" Starting up, "R" Reading Request, "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, "C" Closing connection, &q...

PHP mail function #2
Hello, can any one help me with the following issue: I use PHP mail function to send emails, when I receive these emails I find some exclamation marks (!) added in the text, this is weird. Can any one help me. Hello, on 02/13/2008 05:39 PM Ahmad said the following: > Hello, can any one help me with the following issue: > > I use PHP mail function to send emails, when I receive these > emails I find some exclamation marks (!) added in the text, this is > weird. Can any one help me. It seems you have lines in your messages that need to be encoded properly with quoted-printable encoding. You may want to try this MIME message compose and sending class that can do that for you without having to learn too much about message encoding standards: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ ...

PHP mail() function and maillog
Hello. Under linux, when I use the mail() function in php there seems to be no record of it in any mail log file or system messages. Anyone know where the log of mails sent might be stored? I know the code to send the mail is running, but I want to confirm that the server is trying to send out the mails. Thanks, Dave. -- Fermat was right. David Gillen wrote: > Hello. > > Under linux, when I use the mail() function in php there seems to be no record > of it in any mail log file or system messages. Anyone know where the log of > mails sent might be stored? I know the code to send the mail is running, but > I want to confirm that the server is trying to send out the mails. > > Thanks, > Dave. The default location of the mail log on linux machines is: /var/log/mail ...

PHP mail function is spammer?
I don't understand why any message sent with mail functions is automatically stored in the spam by Gmail. Sillaba While the city slept, Sillaba atona (NOSPAM@tin.it) feverishly typed... > I don't understand why any message sent with mail functions is > automatically stored in the spam by Gmail. > There could be many and varied reasons... Are you setting a return path? And is that the same as the address the mail "comes" from? Does the mail you are sending have a "from" address that corresponds to the server you are sending from? Does the mail you are sending have anything in it that could be construed as spam? eg, html email with much graphics, little text, etc Is the server you are running off on any spam lists? There are more issues to consider, but I can't think of any right now (just come back from the pub ;-) ) Theoretically, if you are sending a few emails out from the mail function, you shouldn't suffer too much, unless some of, or all, or more than, the above are an issue. Hope that helps, Nige -- Nigel Moss http://www.nigenet.org.uk Mail address will bounce. nigel@DOG.nigenet.org.uk | Take the DOG. out! "Your mother ate my dog!", "Not all of him!" On 2007-08-01, nice.guy.nige <nigel_moss@deadspam.com> wrote: > Are you setting a return path? And is that the same as the address the mail > "comes" from? > Does the mail you are sending have a "from" address th...

PHP mail () function configuration
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not working and the from is set to be my host provider email is the sender, so they told me to configure the php.ini file and i dont know what is this file and how to configure it. thanks in advance shror www.s7els7.com www.beachtoursegypt.com www.mobidp.com On Feb 22, 2:32 am, "shror" <shahi...@gmail.com> wrote: > hi every body, > > i have a problem which is when i was checking my mail() form it work > fine but the problem is that the form configuration is not set > correctly, in details: > the from var is not working and the from is set to be my host provider > email is the sender, so they told me to configure the php.ini file and > i dont know what is this file and how to configure it. > > thanks in advance > > shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobidp.com The php.ini file is your php configuration file, if you are on windows it should be in you c:\windows directory, if you are on linux it should be on you /etc directory (I could be wrong on this, haven't configured php on linux in awhile), not sure where it would go in Mac OS X On 22 Feb, 10:32, "shror" <shahi...@gmail.com> wrote: > hi every body, > > i have a problem which is when i was checking my mail() form it work > fine but the prob...

php mail() function does nothing
Hey everyone, We've got FreeBSD 5.3, with Sendmail running. All we want to do is to get sendmail to send emails to another server for actual outbound email. We've got a very basic php script which utilizes the mail() function, but for some reason, sendmail is never getting the command from PHP. So, we can successfully send email using sendmail from the command prompt, but when it comes to using the PHP mail() function, nothing happens. Not even an error message from PHP. We have in our php.ini a direct path all the way to sendmail configured. I'm at a loss as to why PHP mail() isn't even spitting back an error. The maillog shows nothing from PHP. Are there any variables, extensions that need to be compiled, etc to make mail() work? Thanks!! tencip: > > We have in our php.ini a direct path all the way to sendmail > configured. I'm at a loss as to why PHP mail() isn't even spitting > back an error. The maillog shows nothing from PHP. > > Are there any variables, extensions that need to be compiled, etc to > make mail() work? Did you set sendmail_from? That may be it as well. Also perform a trace of sendmail when PHP goes to send an email. Also note from the manual: " For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come wit...

PHP mail() function in chroot
On my webserver the web components are seperated into a chroot jail so it cannot access any of the mail (courier-mta) components. Does anyone know of a way to change how mail() functions? i.e. have it connect to an smtp server, rather than try to refrence the sendmail binary? Any help would be greatly appreciated! thanks. This is a multi-part message in MIME format. ------=_NextPart_000_00C2_01C3E745.A30A3260 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable http://phpmailer.sourceforge.net/ ____________________________________ Wil Moore III, MCP | Integrations Specialist | Senior Consultant DigitallySmooth Inc. | Quick Site Studio "Andy" <nospam@nospam.com> wrote in message = news:UrxSb.8782$%72.7644@twister.nyroc.rr.com... On my webserver the web components are seperated into a chroot jail so = it cannot access any of the mail (courier-mta) components. Does = anyone=20 know of a way to change how mail() functions? i.e. have it connect to = an=20 smtp server, rather than try to refrence the sendmail binary? Any = help=20 would be greatly appreciated! thanks. ------=_NextPart_000_00C2_01C3E745.A30A3260 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859...

PHP mail and MS Exchange
Hi, when I use php mail() I can send mail to my gmail account without any problems. When I try to send to the company Exchange server nothing seems to happen. The mail sends successfully but it never arrives. How can I track down what is going on here? Thanks! On 14 Sep, 14:48, sso <strongsilent...@gmail.com> wrote: > Hi, > > when I use php mail() =A0I can send mail to my gmail account without any > problems. =A0When I try to send to the company Exchange server nothing > seems to happen. =A0The mail sends successfully but it never arrives. > > How can I track down what is going on here? > > Thanks! My definition of successfully sending mail is that it does indeed arrive at its destination. On Sep 14, 10:00=A0am, Captain Paralytic <paul_laut...@yahoo.com> wrote: > On 14 Sep, 14:48, sso <strongsilent...@gmail.com> wrote: > > > Hi, > > > when I use php mail() =A0I can send mail to my gmail account without an= y > > problems. =A0When I try to send to the company Exchange server nothing > > seems to happen. =A0The mail sends successfully but it never arrives. > > > How can I track down what is going on here? > > > Thanks! > > My definition of successfully sending mail is that it does indeed > arrive at its destination. I agree :) Have you any further incites? On Sep 14, 10:05=A0am, sso <strongsilent...@gmail.com> wrote: > On Sep 14, 10:00=A0am, Captain Para...

PHP mail() function problem
Hi all, I want to send mails using php mail() function, my web server is apache on linux i just add this line to my code ini_set('sendmail_from', 'users@must.edu.eg'); i'm sending emails to users at the same domain ....@must.edu.eg but it didn't send mail also it don't give any errors but i'm sure that mail server is working coz when i'm trying to send mails to the same domain through outlook it works well. i tried to send to hotmail it sends just one mail but when i tried again the same happened no mails sent with no error. where do u think the problem???? noha khalifa wrote: > Hi all, > > I want to send mails using php mail() function, my web server is > apache on linux i just add this line to my code > ini_set('sendmail_from', 'users@must.edu.eg'); > > i'm sending emails to users at the same domain ....@must.edu.eg but it > didn't send mail also it don't give any errors > > but i'm sure that mail server is working coz when i'm trying to send > mails to the same domain through outlook it works well. > > i tried to send to hotmail it sends just one mail but when i tried > again the same happened no mails sent with no error. > > where do u think the problem???? You didn't show your code, so it's impossible to tell. You shouldn't be using ini_set for 'sendmail_from' - that's just a default value. Rather, you should be ...

why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php?
I have a PHP script at 127.0.0.1/test.php. It's contents are as follows: <?php echo $_SERVER['PHP_SELF']; ?> And it's output isn't test.php, as I'd expect, or /test.php, but rather, /test.php/test.php. Why? And how do I fix it? El 06/10/2010 6:53, yawnmoth escribi�/wrote: > I have a PHP script at 127.0.0.1/test.php. It's contents are as > follows: > > <?php > echo $_SERVER['PHP_SELF']; > ?> > > And it's output isn't test.php, as I'd expect, or /test.php, but > rather, /test.php/test.php. Why? And how do I fix it? What output do you get if you change it to this? <?php echo '[' . $_SERVER['PHP_SELF'] . ']'; ?> What do your other $_SERVER values look like? <?php print_r($_SERVER); ?> -- -- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programaci�n web: http://borrame.com -- Mi web de humor satinado: http://www.demogracia.com -- On 06/10/10 09:30, "�lvaro G. Vicario" wrote: > El 06/10/2010 6:53, yawnmoth escribi�/wrote: >> I have a PHP script at 127.0.0.1/test.php. It's contents are as >> follows: >> >> <?php >> echo $_SERVER['PHP_SELF']; >> ?> >> >> And it's output isn't test.php, as I'd expect, or /test.php, but >> rather, /test.php/test.php. Why? And how do I fix it? > > What output do you get if you change it ...

Web resources about - MS-Windows mail servers and PHP's mail() function - comp.lang.php

MS Windows 10 - 24/7 Wall St.
Microsoft Windows 10 operating system OS software

MS Windows 8.1 RTM and VS 2013 RC Available to Developers
Microsoft's call to build and test your apps for Windows 8.

MS Windows NT Kernel-mode User and GDI White Paper
Microsoft Windows NT Workstation 4.0 and Windows NT Server 4.0 include a change in the implementation of Win32 graphics-related application programming ...

MS Windows Live Essentials rides new wave
The beta of Microsoft's latest update of its free Windows Live Essentials line of online applications which Microsoft calls Wave 4 was recently ...

MS Windows Chief: I Wasn't Fired, I Quit, and I'll Take on Microsoft
Steven Sinofsky, Microsoft's longtime Windows executive, shocked many in the tech community when he stepped down on Monday night. In a memo ...

Resources last updated: 3/29/2016 1:31:59 AM