Problem Sending an email with XAMPP through HTML_QuickForm

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Problem Sending an email with XAMPP through HTML_QuickForm

Postby powderskier » 16. November 2005 18:31

Hello All,

Can you please tell me what is required to send an email from an HTML_QuickForm through XAMPP.

I am currently running Suse Linux Professional 9.3
XAMPP for Linux 1.4.16

I have read that I need to;

"You need to check and possibly change one variable in the php.ini file if you’re using Unix: sendmail_path, a string containing the full path to your sendmail program (usually /usr/sbin/sendmail or /usr/lib/sendmail), a replacement, or a wrapper (such as /var/qmail/bin/sendmail).

If you are not using sendmail, and you do not reset this configuration directive to the correct alternative daemon, your mail transfer may be very slow, as several alternative programs are tried and allowed to time out before the correct one is found."

I have tried the above steps but no luck receiving mail.

I am able to do the following:

- create a simple HTML_QuickForm based form and then display the data on screen through PHP
- I can submit the email and be sent to the page where the form has been processed, but no email is sent to the specified address

Here is the HTML_QuickForm code:

// Load the main class
require_once 'HTML/QuickForm.php';
// Instantiate the HTML_QuickForm object
$form = new HTML_QuickForm('send_email');
$form->addElement('text','subject','Subject: ','size="30" maxlength="128"');
$form->addElement('textarea','body','Message Body: ','rows="10" cols="30"');
$form->addElement('submit','send','Send Message'); $data = $form->getSubmitValues();
if ($data['send']) {
mail('mnaumowicz@equitabletrust.com',$data['subject'],$data['body']);
print "Your message has been sent.";
} else {
$form->display();
}
?>

Can you please tell me how I can do a simple test to confirm that mail is being processed from the SUSE system through XAMPP?

Thanks,

powderskier

:?:
powderskier
 
Posts: 5
Joined: 16. November 2005 17:32

Postby krelvinaz » 17. November 2005 04:40

Try testing the sendmail link first to make sure it works.

Create a simple text file with some basic headers and have sendmail send it.

text.txt containing...
Code: Select all
From: yourname@domain.tld
To: yourname@domain.tld
Subject: Test message

This is a test message


Then try sending it via the sendmail command.

Code: Select all
/usr/lib/sendmail -t < test.txt


or use the proper path to your sendmail file.

If that doesn't work, you need to fix that first.
Kevin
User avatar
krelvinaz
 
Posts: 79
Joined: 02. October 2005 05:46
Location: Mesa, AZ USA

Sendmail is configured correctly

Postby powderskier » 17. November 2005 18:11

Hello,

I need to provide some more information to clarify. First, the system where XAMPP is installed, does not run our mail server. The mail server is running on another system.

What I need to know is how do you configure php.ini to point to a server that XAMPP is not installed on? Is this possible? Is there another way to setup a mail server on the Suse machine, then have this relay mail to our network clients?

I just want to submit a form, and have the email routed to our mail server.

Thanks to everyone for your time,

Mark

BTW, I have ran the /usr/lib/sendmail -t < test.txt test and I received mail without issue.

Suse Linux 9.3 Professional
XAMPP for Linux 1.4.16
powderskier
 
Posts: 5
Joined: 16. November 2005 17:32

Postby animedown » 15. November 2006 04:35

I am having the same problem. I was able to send the email test.txt through ssh. with the command /usr/lib/sendmail -t < test.txt

But then I can not send emails through php. A sample code i used was

Code: Select all
<?php
// Load the main class
require_once 'HTML/QuickForm.php';
// Instantiate the HTML_QuickForm object
$form = new HTML_QuickForm('send_email');
$form->addElement('text','subject','Subject: ','size="30" maxlength="128"');
$form->addElement('textarea','body','Message Body: ','rows="10" cols="30"');
$form->addElement('submit','send','Send Message'); $data = $form->getSubmitValues();
if ($data['send']) {
mail('myemailaddress@gmail.com',$data['subject'],$data['body']);
print "Your message has been sent.";
} else {
$form->display();
}
?>


would it have anything to do with firewall or I didn't configed it correctly.

All I did was install sendmail, i simply used apt-get install sendmail from debian package. Then I only modified /opt/lampp/etc/php.ini
Code: Select all
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
animedown
 
Posts: 5
Joined: 03. July 2006 05:06

Postby animedown » 20. November 2006 08:11

bump? I noticed that this thread have recieved lots of views, 700+ views. and there's no solution posted yet, I am sure there are others that are having the same problem too.
animedown
 
Posts: 5
Joined: 03. July 2006 05:06

Mine is Working

Postby pablovelme » 13. August 2007 20:50

I am running kubuntu feisty fawn.

I had to install sendmail with sudo apt-get sendmail

after that I tried an email via the console, and it worked, (although it took like 30 seconds to send the email)

I added this to my php.ini
/usr/lib/sendmail

and my script didn't work, but I read that the default is sendmail -t
so I left it commented,tried my php script again, it took like 30 seconds and the email got out.

right now this is acceptable for me as this server is only for development, I don't know if the time is taking is due to the ISP or to the configuration.

ohh by the way, don't forget to restart xampp once you change something in the .ini
pablovelme
 
Posts: 1
Joined: 13. August 2007 20:43

Postby vincentrich » 14. September 2007 14:55

I have installed sendmail and edited php.ini. Is there anything else to edit like a sendmail config file to be able to send emails from my ubuntu server? My php scripts do not seem to be sending any emails now.
vincentrich
 
Posts: 45
Joined: 19. January 2005 10:05
Location: Singapore


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 3 guests