11 Replies - 609 Views - Last Post: 17 May 2012 - 07:40 PM Rate Topic: -----

#1 Tsukuyomi  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 95
  • Joined: 22-February 11

Someone sending an Email to Me help

Posted 15 May 2012 - 08:17 PM

I have a form where someone can send me a message but I do not seem to get the e-mail.

here is the html file:

<!DOCTYPE HTML>
<html>
<head>
<title>Financial E-mail: Send us questions.</title>

<hr/>
<style type="text/css">
body
{
background-color: rgb(98,21,153);;
background-position: top;
background-repeat: no-repeat; 
color: gold;

}
a:link {color:rgb(255,215,0);}/* unvisited link */
a:visited {color:rgb(205,215,03);}/* visited link */
a:hover {color:rgb(0,0,0);}  /* mouse over link */
a:active {color:rgb(255,255,255);} /* selected link */
.center
{
margin:auto;
width:70%;
}
p.italic {font-style:italic;}
p.oblique {font-style:oblique;}
p.color {color:azure};


</style>
</head>

<body>
<p> Here you can send questions to the website moderator viva e-mail. Any flaws or bugs should be sent to this address:financialmod@yahoo.com</p>
<br/>
<br/>

<form method="post" action="FinancialEmail.php" >
<p>Email Address: <input type="text" name ="email" size="40" /> </p>
<p>Subject: <input type="text" name ="subject" size="20" /> </p>
<p>MessageS:<textarea name='message' rows='15' cols='40'>
  </textarea>
</p>

<input type="submit" name ="submit" value="Submit!"/>
</body>
</html>




here is the php file:

<!DOCTYPE HTML>
<html>
<head>
<title>Financial E-mail: Send us questions.</title>

<hr/>
<style type="text/css">
body
{
background-color: rgb(98,21,153);;
background-position: top;
background-repeat: no-repeat; 
color: gold;
}
a:link {color:rgb(255,215,0);}/* unvisited link */
a:visited {color:rgb(205,215,03);}/* visited link */
a:hover {color:rgb(0,0,0);}  /* mouse over link */
a:active {color:rgb(255,255,255);} /* selected link */
.center
{
margin:auto;
width:70%;
}
p.italic {font-style:italic;}
p.oblique {font-style:oblique;}
p.color {color:azure};


</style>
</head>

<body>

<br/>
<br/>
<?php

$email1 = $_POST['email'];
$subject1 = $_POST['subject'];
$message1 = $_POST['message'];
 
 /*

if ( mail($email, $subject, $message) )
{
     echo("Your email message was successfully sent.");
}
else
{
     echo("Sorry, message delivery failed. Contact webmaster for more info.");
}
*/

/*

<form method="post" action="contact.php"> 
 Email: <input name="email" type="text"><br>
 Message:<br> 
 <textarea name="message" rows="15" cols="40"></textarea><br> 
 <input type="submit"> 
 </form> 
  //<?php 
  */  
 
 //if(isset(
 $message = $message1;
 $to = "financialmod@yahoo.com"; 
 $subject = $subject1; 
 $email = $email1; 
 $from = '$email1';
 $headers = "From: " .$email;
 mail($to, $subject, $message, $headers);
 echo "Mail Sent."; 


 /*$message = $_REQUEST['message'] ; 
 $sent = mail($to, $subject, $message, $headers) ; 
 if($sent) 
 {print "Your mail was sent successfully"; }
 else 
 {print "We encountered an error sending your mail"; }
 ?> 
?>

*/

?>
</html>
</body>



Is This A Good Question/Topic? 0
  • +

Replies To: Someone sending an Email to Me help

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10660
  • View blog
  • Posts: 39,581
  • Joined: 27-December 08

Re: Someone sending an Email to Me help

Posted 15 May 2012 - 08:42 PM

The mail() function returns a value. If true, the mail() function successfully delivered the message to your server, but makes no promises that the server sent the message to the recipient. If false, the message was not even sent to the server. Check this as your starting point.
Was This Post Helpful? 0
  • +
  • -

#3 Tsukuyomi  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 95
  • Joined: 22-February 11

Re: Someone sending an Email to Me help

Posted 15 May 2012 - 08:49 PM

View Postmacosxnerd101, on 15 May 2012 - 08:42 PM, said:

The mail() function returns a value. If true, the mail() function successfully delivered the message to your server, but makes no promises that the server sent the message to the recipient. If false, the message was not even sent to the server. Check this as your starting point.

Sorry, I do not understand. Can you give me an example?
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10660
  • View blog
  • Posts: 39,581
  • Joined: 27-December 08

Re: Someone sending an Email to Me help

Posted 15 May 2012 - 08:55 PM

You seem to understand, because you have this in the comments of one of your Files:
$sent = mail($to, $subject, $message, $headers) ;
78	 if($sent)
79	 {print "Your mail was sent successfully"; }
80	 else
81	 {print "We encountered an error sending your mail"; }


Was This Post Helpful? 1
  • +
  • -

#5 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Someone sending an Email to Me help

Posted 15 May 2012 - 09:45 PM

View Postmacosxnerd101, on 15 May 2012 - 11:55 PM, said:

You seem to understand, because you have this in the comments of one of your Files:

Or more accurately, it is commented in one of his files. It was probably commented by the author.
Was This Post Helpful? 0
  • +
  • -

#6 Tsukuyomi  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 95
  • Joined: 22-February 11

Re: Someone sending an Email to Me help

Posted 16 May 2012 - 09:46 AM

View Postmacosxnerd101, on 15 May 2012 - 08:55 PM, said:

You seem to understand, because you have this in the comments of one of your Files:
$sent = mail($to, $subject, $message, $headers) ;
78	 if($sent)
79	 {print "Your mail was sent successfully"; }
80	 else
81	 {print "We encountered an error sending your mail"; }


Can someone tell me how to fix my errors?
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10660
  • View blog
  • Posts: 39,581
  • Joined: 27-December 08

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 12:08 PM

I've told you how to start identifying what specifically is your problem. Start by determining what the root of the problem is.
Was This Post Helpful? 0
  • +
  • -

#8 Tsukuyomi  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 95
  • Joined: 22-February 11

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 07:04 PM

View Postmacosxnerd101, on 17 May 2012 - 12:08 PM, said:

I've told you how to start identifying what specifically is your problem. Start by determining what the root of the problem is.
The problem is that it won't send the email. I just don't know what to do to fix it that's why I posted on here.
Was This Post Helpful? -1
  • +
  • -

#9 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,286
  • Joined: 28-March 11

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 07:18 PM

Just want answers handed to you without learning. PHP is widely documented.

FIRST AND MOST IMPORTANT - Does your server allow you to send mail?

create a text file and paste this into it:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>


save it as info.php and upload to your server in the root directory, then goto your website and add info.php to the end
www.example.com/info.php and see if there is a sendmail path, if not then you are SOL

This post has been edited by GunnerInc: 17 May 2012 - 07:18 PM

Was This Post Helpful? 0
  • +
  • -

#10 Tsukuyomi  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 95
  • Joined: 22-February 11

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 07:23 PM

View PostGunnerInc, on 17 May 2012 - 07:18 PM, said:

Just want answers handed to you without learning. PHP is widely documented.

FIRST AND MOST IMPORTANT - Does your server allow you to send mail?

create a text file and paste this into it:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>


save it as info.php and upload to your server in the root directory, then goto your website and add info.php to the end
www.example.com/info.php and see if there is a sendmail path, if not then you are SOL

Yes, it allow me to send e-mails
Was This Post Helpful? 0
  • +
  • -

#11 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,286
  • Joined: 28-March 11

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 07:36 PM

So then start simple, I added this to a file and uploaded to my server and "ran" it and it sent me an email:
<?php

$message = "Just a test";
$to = "XXXXXX@gunnerinc.com"; 
$subject = "PHP Email Test"; 
$email = "XXX@gunnerinc.com"; 
$from = $email1;
$headers = "From: " .$email;
mail($to, $subject, $message, $headers);

?>


I am bored atm so I am doing this, otherwise you will not get much help (actually hand holding) from folks here especially when they told you where to start. Does mail return TRUE or FALSE????? If it returns FALSE then it must be in the the way you are formating something NO? I don't know PHP but if it were me, I would lookup the mail function and read into it.
Was This Post Helpful? 1
  • +
  • -

#12 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10660
  • View blog
  • Posts: 39,581
  • Joined: 27-December 08

Re: Someone sending an Email to Me help

Posted 17 May 2012 - 07:40 PM

Quote

The problem is that it won't send the email. I just don't know what to do to fix it that's why I posted on here.

I told you what your next step is, as did GunnerInc. At this point, this applies:
Posted Image

Quote

Does he ask the same, tired questions others ask (at a rate of once or more per minute)?
Does he clearly lack the ability or inclination to ask the almighty Google?
Does he refuse to take the time to ask coherent, specific questions?
Does he think helping him must be the high point of your day?
Does he get offensive, as if you need to prove to him why he should use Ruby on Rails?
Is he obviously just waiting for some poor, well-intentioned person to do all his thinking for him?
Can you tell he really isnít interested in having his question answered, so much as getting someone else to do his work?

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1