-2

If a php form is completed and send with the submit button, how can I send an e-mail together to an administrator for example? I want to sent the user's name who created a new user through a form

The creator is coming from $_SESSION['username'].

Can I use the PHP mail function to do this?

Bale
  • 7
  • 5
  • 1
    yes you can, what have you tried so far? – Steve Apr 30 '14 at 14:12
  • Before asking this question, if you have some idea of a function that you may be able to use, you should really read the documentation for said function first. [mail()](http://us3.php.net/manual/en/function.mail.php) – Patrick Q Apr 30 '14 at 14:16

3 Answers3

1

If mail is correctly set up in your php.ini file you can use this.

You can also install and use PHPMailer if you want access to a full SMTP server or a lot more fine control over how your email is built.

Skrrp
  • 660
  • 7
  • 11
1

Yes you can use the mail function. You just have to send the input field value's from the form in the mail function.

Babidi
  • 74
  • 12
0

Yes. I've posted a rather simple example on SO before which you can take a look at, also there are numerous examples elsewhere on the internet that provide you details for the task.

Community
  • 1
  • 1
Jonast92
  • 4,964
  • 1
  • 18
  • 32