mail in Xampp OSX

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

mail in Xampp OSX

Postby Gus » 30. September 2008 12:00

Hello,

I'm new to Xampp on OSX, and I would like to know the right settings to sent mail.

I've tried to change the settings on my php.ini file but it doesn't work. Is it even possible to sent mail with only Xampp on OSX?


Below are my settings: works under windows.
---------------------------------------
[mail function]
; For Win32 only.
;SMTP = mail.chello.nl
;smtp_port = 25

; For Win32 only.
;sendmail_from = myemailadress.nl

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "\xampp\sendmail\sendmail -t"
---------------------------------------

Please help, I've searched but didn't find anything useful.

Thnkx,

Gus
Gus
 
Posts: 5
Joined: 30. September 2008 11:44

Postby Wiedmann » 30. September 2008 12:11

I've tried to change the settings on my php.ini file

Why have you changed these settings?

but it doesn't work.

Why not (error message, ... ?)

Is it even possible to sent mail with only Xampp on OSX?

AFAIK PHP is just using the preinstalled email server software from Mac OS X (IMHO Postfix).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Gus » 30. September 2008 12:26

Wiedmann wrote:
I've tried to change the settings on my php.ini file

Why have you changed these settings?

I'm trying to make Drupal sent mail, but it doesn't work as it gives an error:

but it doesn't work.

Why not (error message, ... ?)


Drupal gives the following error: Unable to send mail. Please contact the site admin.


Thankx in advance
Gus
 
Posts: 5
Joined: 30. September 2008 11:44

Postby Wiedmann » 30. September 2008 12:31

Drupal gives the following error: Unable to send mail. Please contact the site admin.

This error message from Drupal is really not helpfull. Can you enable a debug output in Drupal? (Or ask the Drupal support what is the exact reason for this error message)

With the default PHP settings you can try to send a mail with your own testscript:
http://de.php.net/manual/en/function.mail.php
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Gus » 30. September 2008 12:58

I've tried to mail myself with the mail script from Xampp...
--------------------
<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}

$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to="myemail@myhost.nl";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
--------------------
It gives this error: "There was a problem sending the mail. Please check that you filled in the form correctly."

I have no clue how to get information about this error. I have firebug installed.

Thnkx again
Gus
 
Posts: 5
Joined: 30. September 2008 11:44

Postby Wiedmann » 30. September 2008 13:12

I've tried to mail myself with the mail script from Xampp...

You have seen my link above? Try Example #1 from that page.

But it's a good idea to add the line
Code: Select all
error_reporting(E_ALL);

after "<?php".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Gus » 30. September 2008 13:25

You have seen my link above? Try Example #1 from that page.

Yes, I have. Thank you. I didn't work. It showed me a white screen with no information. Error logging error_reporting(E_ALL); also doesn't show up.
Gus
 
Posts: 5
Joined: 30. September 2008 11:44

Postby Wiedmann » 30. September 2008 13:33

It showed me a white screen with no information. ... error_reporting(E_ALL); also

So there was no problem for PHP to send this mail. (This script have no output)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Gus » 30. September 2008 13:38

No... the php works just fine...

But I still don't get an email when the form is posted ... I would like to know the right settings in Xampp (php.ini)
Gus
 
Posts: 5
Joined: 30. September 2008 11:44

Postby Wiedmann » 30. September 2008 14:35

But I still don't get an email when the form is posted ...

In this case you can search in the logs from your mailer (Postfix) for additional infos.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

sendmail xampp osx

Postby Manuzzi » 28. October 2008 00:24

I also would like to know the right settings for sendmail. Do i first have to install "sendmail" or something like that first?
gr, Herman

Gus wrote:No... the php works just fine...

But I still don't get an email when the form is posted ... I would like to know the right settings in Xampp (php.ini)
Manuzzi
 
Posts: 5
Joined: 28. October 2008 00:15
Location: Groningen NL

Re: sendmail xampp osx

Postby glitzi85 » 28. October 2008 01:41

Manuzzi wrote:I also would like to know the right settings for sendmail. Do i first have to install "sendmail" or something like that first?
gr, Herman

OSX is installed with postfix (it's another mailing program comparable to sendmail) by default, normally mail transport should work without any problems. If your Mailing-script doesn't work you should follow the instructions in this post and test the mail function in general (http://de.php.net/manual/en/function.mail.php - First example).

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: sendmail xampp osx

Postby Manuzzi » 28. October 2008 09:45

The php script is working on the production site. I had the mail function working on my former Apache installation on Mac OSX, but with XAMPP installed now I don't know how to do it.

Herman

glitzi85 wrote:OSX is installed with postfix (it's another mailing program comparable to sendmail) by default, normally mail transport should work without any problems. If your Mailing-script doesn't work you should follow the instructions in this post and test the mail function in general (http://de.php.net/manual/en/function.mail.php - First example).

glitzi
Manuzzi
 
Posts: 5
Joined: 28. October 2008 00:15
Location: Groningen NL

Re: sendmail xampp osx

Postby glitzi85 » 28. October 2008 15:16

Manuzzi wrote:I had the mail function working on my former Apache installation on Mac OSX, but with XAMPP installed now I don't know how to do it.

You do not have to do anything. The mail function should work without any problems. Do you have any problems?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: sendmail xampp osx

Postby Manuzzi » 29. October 2008 22:20

Thanks Glitzi for your reaction for I started thinking in a different direction: my provider is not delivering the mails. It works now after choosing another email account to sent the messages to.
gr. Herman.

You do not have to do anything. The mail function should work without any problems. Do you have any problems?

glitzi
Manuzzi
 
Posts: 5
Joined: 28. October 2008 00:15
Location: Groningen NL

Next

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 11 guests