?
Solved

Trying To Send Email from variable

Posted on 2014-03-03
9
Medium Priority
?
332 Views
Last Modified: 2014-03-04
I have a form that I want to send an email to the email address that is put in the email field.  However what I did is not working.

http://www.bricooper.com

Click on "Share"

This is what I put.
// User settings
$to = "$email";
$subject = "Bri Cooper";

Open in new window

contact.php
0
Comment
Question by:DS928
  • 5
  • 3
9 Comments
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 1400 total points
ID: 39902483
Did you get any error message on the screen? You can try like this in the variable,
$to = $email;

Open in new window

0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 39902487
I tested your form and it is being submitted and it says, "Your message was successfully sent. " .. .just your inbox/spam folders whether you've got any email.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 39902493
I just checked my inbox, it has come... so please change the email id here,

$to = "user@yourdomain.com";  /// your email ID to receive... not $email  

$email -> refers who is submitting the form...

So, it should be

$to = YOUR EMAIL ID;

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:DS928
ID: 39902500
OK, I need to set the form up so that where it says "Friends Email" this where the email goes to.  I am not getting any errors.  It has to work to where whatever email is in the Friends Email field, thats where the email will be sent to.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 39902520
Yes, you're correct, then it works... what is the question now?
0
 

Author Comment

by:DS928
ID: 39902529
It doesnt work when i try it.  Put your email in the field on the form and see if you receive it
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 39902533
first time, it was worked.. now it is not...did you change anything?
0
 

Author Comment

by:DS928
ID: 39902552
$to = $email;

Is this correct?
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 600 total points
ID: 39902620
If you are trying to create a form to send email to others whose email is entered in the form by the user, you are creating a very inviting spam generator.  A malicious spammer can write a simple program that can use your form to send email to thousands of people until your ISP or web host shuts down your account.  Putting a form like that on your site is simply a bad idea.
1

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question