send e mail using php(wamp)

sending auto reply email using php(wamp)

Page 1 of 1

3 Replies - 2405 Views - Last Post: 26 August 2009 - 03:30 PM Rate Topic: -----

#1 dan751960@yahoo.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-August 09

send e mail using php(wamp)

Posted 26 August 2009 - 08:45 AM

When I run this script at localhost in wamp it gives ,

The email($email_subject) was NOT sent.

Pls sir can you help me to rectify this problem.

Code follows,

<?php
$email_to = "samantha@ntc.gov.lk";
$email_subject = "Test E-Mail (This is the subject of the E-Mail)";
$email_body = "This is the body of the Email \nThis is a second line in the body!";

if(mail($email_to, $email_subject, $email_body)){
echo "The email($email_subject) was successfully sent.";
} else {
echo "The email($email_subject) was NOT sent.";
}
?>



Samantha
php beginner

This post has been edited by dan751960@yahoo.com: 26 August 2009 - 08:47 AM


Is This A Good Question/Topic? 0
  • +

Replies To: send e mail using php(wamp)

#2 RPGonzo  Icon User is offline

  • // Note to self: hmphh .... I forgot
  • member icon

Reputation: 151
  • View blog
  • Posts: 954
  • Joined: 16-March 09

Re: send e mail using php(wamp)

Posted 26 August 2009 - 08:59 AM

If i remember right you have to set up a SMTP server or the likes to be able to email using WAMP from your local machine ...
Was This Post Helpful? 0
  • +
  • -

#3 Wimpy  Icon User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: send e mail using php(wamp)

Posted 26 August 2009 - 11:54 AM

Yup! :)

View PostRPGonzo, on 26 Aug, 2009 - 05:59 PM, said:

If i remember right you have to set up a SMTP server or the likes to be able to email using WAMP from your local machine ...

Was This Post Helpful? 0
  • +
  • -

#4 jazzer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 20
  • Joined: 18-February 09

Re: send e mail using php(wamp)

Posted 26 August 2009 - 03:30 PM

left click on the wamp icon in the system tray, select php then php.ini. find this setting: smtp=, and put in the smtp server name your sending your email through.
This is usually the smtp server name of your isp. ie. mail1.eircom.net in my case.
Also set sendmail_from to include your email address.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1