mail() function

Problems with the Windows version of XAMPP, questions, comments, and anything related.

mail() function

Postby Aronn00 » 22. February 2013 14:43

Hello, i have to make a account verification php script for a school project and the ideea is that i can't get the mail. This is my php script:
Code: Select all
$mess="Your account have been registered. To activate click <a href='localhost/atestat3/activ.php?x=" . $rand . "'>here</a>.";
$mess=wordwrap($mess, 70, "\r\n");
mail($_POST['email'], 'Activation', $mess);

I read some posts that i need to configure something is php.ini, I tried some of the methods but it didn't work. I am using XAMPP v.1.8.1.
I want to use the mail with localhost if it's possible because i won't be able to install aditional programs.
Need help. Thanks!
Aronn00
 
Posts: 2
Joined: 22. February 2013 14:37
XAMPP Version: 5.6.3
Operating System: Windows 7 Ultimate

Re: mail() function

Postby Nobbie » 22. February 2013 15:14

PHP cannot send mails on its own, even not with the mail function. This (very limited) mail function is only a relatively poor interface to an Email Server; you definitaly need a running SMTP Server (either on localhost or somewhere remotely) to send emails.

The mail function does not support Autorization on SMTP Servers.
Nobbie
 
Posts: 6491
Joined: 09. March 2008 13:04

Re: mail() function

Postby Aronn00 » 22. February 2013 15:57

And how do i do that?
Aronn00
 
Posts: 2
Joined: 22. February 2013 14:37
XAMPP Version: 5.6.3
Operating System: Windows 7 Ultimate

Re: mail() function

Postby JonB » 22. February 2013 20:59

You can use the 'sendmail' MTA (Mail Transfer Agent) included with XAMPP - There's a sendmail.ini file in the folder with examples, it can work standalone or with your ISP's SMTP server.

This question has also been answered dozens of times in this forum.

Good Luck
:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests