Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Mail To Function
(1 viewing) (1) Guest
All your queries regarding HTML will be solved in this forum
  • Page:
  • 1
TOPIC:

Mail To Function

Mail To Function 1 year ago #581

Hello
Am sudhakar new to PHP i want to send a mail using PHP
How can i do that and i need necessary configuration setting to do that.

Thank You

Sudhakar Singagjogi

Re: Mail To Function 1 year ago #583

  • dhuruv
  • OFFLINE
  • Senior Boarder
  • Posts: 60
  • Karma: 0
You can send an email using following PHP codespec:

<?php

// recipient's email address

$to = "recipients_emailaddr_com";

// The subject

$subject = "Enter your subject here";

// The message

$message = "Enter your message here";

$headers =" Additional headers like From,Cc,Bcc ";

mail($to, $subject, $message, $headers);

echo "The email has been sent.";

?>
Last Edit: 1 year ago by dhuruv.

Re: Mail To Function 1 year ago #584

Yes i tried but it is asking me to check the configuration files

some one had said that we have to chk the settings of php.ini and come conf file
Please help me in that

Re: Mail To Function 1 year ago #585

  • dhuruv
  • OFFLINE
  • Senior Boarder
  • Posts: 60
  • Karma: 0
Which operating system are you using for handling your php mails?

Re: Mail To Function 1 year ago #586

Hey dhruv
I had not configured any mail servers because of that am i not executing that code or what?

Am using Windows XP.

Re: Mail To Function 1 year ago #587

  • dhuruv
  • OFFLINE
  • Senior Boarder
  • Posts: 60
  • Karma: 0
Do understand that for the PHP codespec to deliver an Email anywhere, in addition to a Webserver you have to have a Mail server running on your computer as well.

Please do a search in Google for an - XP or Vista or Windows 7 - based Mail server. There are several available for download, some are free and some you may have to pay for.

BTW, normally anything on Microsoft Windows you have to pay for, why not consider switching to Linux which come with a built-in Web server and Mail server for free.

Once you've, downloaded and installed the Mail server on your Windows OS, you have to then inform PHP that such a service exists on your Windows box.

This is done by passing appropriate values against PHP directives in the php.ini file.

BTW, if you do not have any mail server installed and running on your local Windows box, you could consider sending all your Emails via a Yahoo or Google email account.

If you are using a Yahoo or Google Email account to dispatch your Emails using a PHP code block, then appropriate Yahoo or Google information such as (Email) Login ID and Password information need to be added to directives in the PHP.ini file.

Hopefully one of these approaches will get you sending Emails successfully via PHP code spec.
Last Edit: 1 year ago by dhuruv.
  • Page:
  • 1
Time to create page: 2.46 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download