-1

i was wondering if its possible to get user email with PHP?

Example , i want to know my own E-Mail address when I send an e-mail to someone.

i'm finding out is it possible to do so with PHP?

I need some assist

Thanks in advance

user3546239
  • 159
  • 1
  • 10

3 Answers3

1

try this:

    $from = "sender id" // sender
    $subject = "subject";
    $message = 'mail from'.$from.'sender';
    $to = "receiver id";
    // send mail
    $headers = 'From: <test@test.com>' . "\n";
    $headers .= "MIME-Version: 1.0\n" ; 
    $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";

    mail($to,$subject,$message,$headers);
Priya jain
  • 753
  • 2
  • 5
  • 15
1

> i want to know my own E-Mail address when I send an e-mail to someone.

You can not, because you have to specify it yourself in order to make it work.

  • When sending emails directly from PHP using mail() you have to specify the "from" address yourself.
  • When sending emails via a POP3 server (e.g. using the phpmailer class), your login account determines the "from" address.
Barry Staes
  • 3,890
  • 4
  • 24
  • 30
-1

Use PHP's mail() function to send emails.

More detail here:

http://php.net/manual/en/function.mail.php

Noman Ghani
  • 468
  • 3
  • 9