By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

php scripts for email authentication

P: n/a
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('@',$email);
$mailhost = $email[1];
$mailhost=$mailhost.".";

$to = my****@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: Ar***@preteus.net"

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.
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Xerxes écrivit:
I used the php mail() function, using the following (where my email
field on the form is called "email"):

$email = explode('@',$email);
here you are converting the string $email to an array of two items.
$headers = "From: ".$email."\r\n";


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
Jul 16 '05 #2

P: n/a
"Xerxes" <as*******@hotmail.com> wrote in message news:<ac269f8e50395ef6f4b4c4cbee8a64ce@TeraNews>.. .
Hi,
is there any script to authenticate an email address entered in a form
field?


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
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.