sending email from form

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

sending email from form

Postby Dave A » 16. July 2009 19:36

i can connect to db but am stopped in my register form 'cause it says:
An error occurred in script 'C:\xampp\htdocs\reg\5\register.php' on line 78:
mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing
Date/Time: 7-16-2009 14:04:51
i had mercury mail running but i guess that doesn't do it. .not sure what it's for; perhaps some one can let me know that too.
i'm not to computer literate so i hope some one can help. thank you.
Dave A
 
Posts: 49
Joined: 02. July 2009 16:07

Re: sending email from form

Postby Wiedmann » 16. July 2009 20:14

mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing

Your script is buggy and doesn't set a "From" header. (contact the script author).

While you waiting for a bugfix, you can set the value "sendmail_from" in "php.ini".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: sending email from form

Postby Dave A » 16. July 2009 21:02

thanks i guess it's pretty obvious i didn't write the script. but how do i change the php.ini file and what do i enter? thanks
Dave A
 
Posts: 49
Joined: 02. July 2009 16:07

Re: sending email from form

Postby Wiedmann » 16. July 2009 21:10

how do i change the php.ini file

- open the file
- change the value
- save the file

and what do i enter?

I can't know which from address you want have. (usually it's your email address)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: sending email from form

Postby Dave A » 16. July 2009 21:18

i changed php.ini. now to contact php guy
Dave A
 
Posts: 49
Joined: 02. July 2009 16:07

Re: sending email from form

Postby Dave A » 17. July 2009 14:40

what happened to your code for send mail?
here's what i have but get error re $body

Code: Select all
            // Send the email.
            //$body = "Thank you for registering at our User Registration site. To activate your account, please click on this link:\n\n";
            //$body .= "http://www.tottawa.prg/reg/7/activate.php?x=" . mysql_insert_id() . "&y=$a"; //www.tio.ca and it works just leave www.tio/
            //$body .= "activate.php?x=" . mysql_insert_id() . "&y=$a"; //www.tio.com and it works just leave www.tio/
            //mail($_POST['email'], 'Registration Confirmation', $body); //'From: webmaster@temple.ca');
            //added line 80 to end to get xampp to send mail
            
$Text = "This is a test.";
$Html = "<H1>This is a test.</H1>";
$Subject = "PHP Mail Test";
$body .= "activate.php?x=" . mysql_insert_id() . "&y=$a";
$message = '<h3>Thank you for registering! A confirmation email has been sent to your address. Please click on the link in that email in order to activate your account.</h3>';


$headers = "From: deneb118@yahoo.com\n";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 3\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative;
boundary=\"==MIME_BOUNDRY_alt_main_message\"\n\n";
$headers .= "This part of the E-mail should never be seen. If you are
reading this, consider upgrading your e-mail client to a MIME-compatible
client.";

$message .= "--==MIME_BOUNDRY_alt_main_message\n";
$message .= "Content-Type: text/plain; charset=ISO-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $Text . "\n\n";
$message .= "--==MIME_BOUNDRY_alt_main_message\n";
$message .= "Content-Type: text/html; charset=ISO-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
Transitional//EN\">\n";
$message .= "<HTML><BODY>\n";
$message .= $Html . "\n";
$message .= "</BODY></HTML>\n\n";
$message .= "--==MIME_BOUNDRY_alt_main_message--\n";

mail($To, $Subject, $message, $headers $body);
Dave A
 
Posts: 49
Joined: 02. July 2009 16:07


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 53 guests