mail function in php

Hello,

What is needed when using the php function mail to send emails? Email server? Is there any option to use one free? What are the best options?

Thanks in advance.
lulonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
gilbertocortezConnect With a Mentor Commented:
Ubuntu does come with a mail server... you can look at http://www.ubuntu.com/products/whatisubuntu/serveredition/features/mailserver for it's features.

Try running this php script on your server, just replace the email adress to your address and if you get it it means that you already have it set up, if you don't then we will go and try to assist you in setting that up for you.
<?php

//Change the email to your address
mail("youremail@example.com","Testing Mail Function","This is a test message to test the mailing capabilities");

?>

Open in new window

0
 
karoldvlCommented:
Normally it's using the local mailer (sendmail).

See the requirements here:
http://www.php.net/manual/en/mail.requirements.php

and runtime configuration:
http://www.php.net/manual/en/mail.configuration.php

Most of the time you use the mailer on the server you're hosting your website on. Try it and see if it works - it should run without any further configuration.
0
 
lulonAuthor Commented:
Note: I'm using Ubuntu
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
karoldvlCommented:
Then I assume you're having problems sending e-mails using the PHP mail() function on your localhost, yes?
0
 
lulonAuthor Commented:
I haven't even tried yet. I have the code and I know it works cause it has been tested but not in my computer.
0
 
lulonAuthor Commented:
I will try to configure it.

But, do you normally have to have any kind of contract or similar with your ISP in order to be able to send emails to another accounts? Is it normally free or does it cost money?
0
 
karoldvlConnect With a Mentor Commented:
No, with most normal providers you can do what you want. And with Ubuntu you should be able to do it out of the box.
0
 
Mehul_PanchalCommented:
hi ,


mail function working when smtp server is there.so you have mail server then you can implement this and see email.
0
All Courses

From novice to tech pro — start learning today.