/    Sign up×
Community /Pin to ProfileBookmark

passing value(Post) to Mail function

please help me,im passing an email address from 1 page via a form and trying to
Mail it on the second page.

This works:-
[COLOR=Red]mail(“[email protected]“,”registration”, “welcome to
hello”,”From:”.$_POST[’email1′]);[/COLOR]

but i want the mail to be sent with email1 from the form.
ive tried these:-
[COLOR=Navy]$a=$_POST[’email1′];
mail(‘$a’,”registration”, “welcome to
hello”,”From:”.$_
POST[’email1′]);

$a=$_POST[’email1′];
mail($a,”registration”, “welcome to
hello”,”From:”.$_
POST[’email1′]);

mail(‘$_POST[’email1′]’,”registration”, “welcome to
hello”,”From:”.$_
POST[’email1′]);
[/COLOR]
but they all return errors
hope ive been clear enough
thank you

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@chrysJun 07.2005 — Use print_r($_POST) and make sure you are accessing the variable correctly.

What kind of error are you getting?
Copy linkTweet thisAlerts:
@ev66authorJun 07.2005 — when i use mail('$_POST[email1]',"registration".........

the error is

Warning: mail(): SMTP server response: 501 Bad address syntax in nas17entdomainsttenmo.comuserhtdocskwmailer.php on line 10

Warning: Cannot modify header information - headers already sent by (output started at nas17entdomainsttenmo.comuserhtdocskwmailer.php:10) in nas17entdomainsttenmo.comuserhtdocswmailer.php on line 12
Copy linkTweet thisAlerts:
@ev66authorJun 07.2005 — is this what you mean chrys

mail(print_r(email1),"registration", "welcome t.....

tried this but still an error.
Copy linkTweet thisAlerts:
@chrysJun 07.2005 — do

mail( $_POST['email'], etc...);
Copy linkTweet thisAlerts:
@ev66authorJun 07.2005 — thats it.works now.

been trying for ages to make this work.

thanks very much chrys.
Copy linkTweet thisAlerts:
@ev66authorJun 07.2005 — and thanks for quick initial response.

about 30 secs i think.
Copy linkTweet thisAlerts:
@chrysJun 07.2005 — NP, I am on my tech journal all day, but I try to answer here when I have a moment.
×

Success!

Help @ev66 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...