1,105,594 Community Members

Sending emal using Xampp

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have been trying to send email for 2 days. using php I have tried different methods but to no avail .
I am sure I am making some small mistake.
Please can someone give step by step procedure of sending mail using Xampp?

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 
Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

What have you tried that is not working ?

http://expertester.wordpress.com/2010/07/07/how-to-send-email-from-xampp-php/

I followed all the steps .Here is my php

<?php


//email(to,subject,message,headers,parameters)
$to="<swissknife007@gmail.com>";
$subject="Hi";
$message="Hello my friend";
$from="swissknife007@gmail.com";

$headers = "From: sender@sender.com" ;
mail($to,$subject,$message,$headers);
echo" mail sent";

?>

The error I am getting is

Warning: mail() [function.mail]: SMTP server response: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 wp7sm14504615igc.6 in F:\xampp\htdocs\email1.php on line 11
mail sent


Please help now.

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

Your password is set correctly in the ini file ?

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Your password is set correctly in the ini file ?

yes
I in the sendmail.ini it is set correctly
can u repeat the php.ini settings for me as i have changed them quite a lot now only for send mail function.

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

It's in the link in the previous post.

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

yes
I in the sendmail.ini it is set correctly
can u repeat the php.ini settings for me as i have changed them quite a lot now only for send mail function.

somebody help please

yes it doesn't have all the send mail setings though

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = smtp.gmail.com
; http://php.net/smtp-port
;smtp_port = 587;

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = swissknife007@gmail.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = “\”F:\xampp\sendmail\sendmail.exe\” -t”

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "F:\xampp\php\logs\php_mail.log"

are my settings correct?

Member Avatar
fobos
Posting Whiz
351 posts since Feb 2009
Reputation Points: 19 [?]
Q&As Helped to Solve: 68 [?]
Skill Endorsements: 3 [?]
 
0
 
<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("someone@example.com", "$subject",
  $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>

And in your php.ini make sure you have these set correctly
[mail function]
SMTP = "my.mailserver.dom" //localhost, gmail, yahoo..
smtp_port = 25
smtp_username = "" <-- If mail server requires a username
smtp_password = "" <-- If mail server requires a password

//Change values
//PHP_INI_ALL
sendmail_from NULL
//PHP_INI_SYSTEM
sendmail_path "/usr/sbin/sendmail -t -i"

Hope this helps

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("someone@example.com", "$subject",
  $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>

And in your php.ini make sure you have these set correctly
[mail function]
SMTP = "my.mailserver.dom" //localhost, gmail, yahoo..
smtp_port = 25
smtp_username = "" <-- If mail server requires a username
smtp_password = "" <-- If mail server requires a password

//Change values
//PHP_INI_ALL
sendmail_from NULL
//PHP_INI_SYSTEM
sendmail_path "/usr/sbin/sendmail -t -i"

Hope this helps

i am getting this error now
Warning: mail() [function.mail]: Mailserver rejected our "sendmail_from" setting in F:\xampp\htdocs\email1.php on line 11
mail sent

Does ; before any statement in php.ini denote a comment?

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

Correct, ; starts a comment.

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Correct, ; starts a comment.

i had posted my php.ini settings are they correct

Member Avatar
swissknife007
Junior Poster in Training
74 posts since Oct 2008
Reputation Points: 3 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i had posted my php.ini settings are they correct

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port

;smtp_port = 587;
;smtp_username = "swissknife007"
;smtp_password = *************
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = ""
sendmail_path = “F:\xampp\sendmail\sendmail.exe -t”
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = “\”F:\xampp\sendmail\sendmail.exe\” -t”
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "F:\xampp\php\logs\php_mail.log"


No help yet.Do I require phpmailer class?

Member Avatar
fobos
Posting Whiz
351 posts since Feb 2009
Reputation Points: 19 [?]
Q&As Helped to Solve: 68 [?]
Skill Endorsements: 3 [?]
 
0
 

Make sure you change
sendmail_from NULL
to
sendmail_from "blah@something.com"

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

No help yet. Do I require phpmailer class?

Using PHPMailer would've saved you all this hassle.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: