Solved

Trying To Send Email from variable

Posted on 2014-03-03
9
276 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 350 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:DS928
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 36

Expert Comment

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

Author Comment

by:DS928
Comment Utility
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
Comment Utility
first time, it was worked.. now it is not...did you change anything?
0
 

Author Comment

by:DS928
Comment Utility
$to = $email;

Is this correct?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 150 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Responsive Design Tools 6 36
Save signature to file 7 44
windows 10 bash shell 4 32
Not needed 13 53
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now