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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
karoldvlCommented:
Then I assume you're having problems sending e-mails using the PHP mail() function on your localhost, yes?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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
gilbertocortezCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
karoldvlCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.