php scripts for email authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xerxes

    php scripts for email authentication

    Hi,
    is there any script to authenticate an email address entered in a form
    field?

    I used the php mail() function, using the following (where my email
    field on the form is called "email"):

    $email = explode('@',$em ail);
    $mailhost = $email[1];
    $mailhost=$mail host.".";

    $to = myname@here.com;
    $subject = "this is the email subject";

    /* message */
    $message = 'text of the message';
    $headers = "From: ".$email."\r\n" ;

    /* and now mail it */
    mail($to, $subject, $message, $headers);

    I do get the an email when I press submit, but the "From: " field is
    nothing like what I entered in the form field.
    It prints something like "From: Array@preteus.n et"

    This is basically for someone who is downloading a utility and I need to
    send him the activation key (and verify the email entered.)

    TIA.


  • P'tit Marcel

    #2
    Re: php scripts for email authentication

    Xerxes écrivit:
    [color=blue]
    > I used the php mail() function, using the following (where my email
    > field on the form is called "email"):
    >
    > $email = explode('@',$em ail);[/color]

    here you are converting the string $email to an array of two items.
    [color=blue]
    > $headers = "From: ".$email."\r\n" ;[/color]

    here you try to convert an array into a string. the result is the word
    "Array" (which is probably not what you are expecting ...)


    --
    P'tit Marcel

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: php scripts for email authentication

      "Xerxes" <ashkaan57@hotm ail.com> wrote in message news:<ac269f8e5 0395ef6f4b4c4cb ee8a64ce@TeraNe ws>...[color=blue]
      > Hi,
      > is there any script to authenticate an email address entered in a form
      > field?[/color]

      The code is quite common. Almost, all books have that script esp
      the one by Rasmus. If you search the net, you can get that one.

      Anyway, the best idea is to send the activation code & ask the user
      to activate. If the user doesn't activate the account within 1 or 2
      weeks then delete the user.

      ---
      "We live to die; we die to live"
      Email: rrjanbiah-at-Y!com

      Comment

      Working...