/    Sign up×
Community /Pin to ProfileBookmark

email problem

hey guys.. trying to send a mail but its throwing an error as such:[B] Warning: Failed to Receive in c:phpdevwwwmobile_test.php on line 92[/B]

im posting in values from a previous page but, they are posting in correctly and inserting into the database but hits the error above at:

[code=php]$mail_result = mail(“[email protected]”, $subject, $message);
[/code]

i cannot see whats wrong with it please advise.
the entire code is …

[code=php]<?php
session_start();//Starts the session for session variables
header(“Cache-control: private”); //Fix for IE6 Step Back
?>
<html>
<head>
<title>Register Success</title>

<style fprolloverstyle>A:hover {color: #0000ff; font-weight: bold}
</style>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″></head>

<?php
$Student_Username = $_POST[‘username’];
$Student_Password = $_POST[‘password’];
$Student_FirstName = $_POST[‘first_name’];
$Student_number = $_POST[‘number’];

session_register(‘$Student_Username’);
session_register(‘$Student_Password’);
session_register(‘$Student_FirstName’);
session_register(‘$Student_number’);

$_SESSION[‘Student_Username’] = $Student_Username;
$_SESSION[‘Student_Password’] = $Student_Password;
$_SESSION[‘Student_FirstName’] = $Student_FirstName;
$_SESSION[‘Student_number’] = $Student_number;

?>

<?php

if((!$Student_Username) || (!$Student_Password) ||
(!$Student_FirstName) || (!$Student_number)){
include ‘mobile_test_a.php’; // Show the form again!
echo ‘<div align=”center”><font color=”#3c8aff”><b>You did not submit
the following required information!</b></div><br />’;
if(!$Student_Username){
echo ‘<div align=”center”><b>Username</b></div><br>’;
}
if(!$Student_Password){
echo ‘<div align=”center”><b>Password</b></div><br>’;
}
if(!$Student_FirstName){
echo ‘<div align=”center”><b>First Name</b></div><br>’;
}
if(!$Student_number){
echo ‘<div align=”center”><b>number</b></div><br>’;
}

echo ‘<div align=”center”><b>Please enter all your details
and click to submit.</b></font></div><br>’;

exit(); // if the error checking has failed, we’ll exit the script!

}
$db = mysql_connect (‘localhost’, ”,”) or die (‘could not connect to MYSQL because: ‘ . mysql_error());

mysql_select_db (blueprintdb) or die (‘could not select the DB because: ‘ . mysql_error());

$sql = mysql_query(“INSERT INTO studentreg(Student_Username,Student_Password,Student_FirstName,Student_number)
VALUES
(‘$Student_Username’,’$Student_Password’,’$Student_FirstName’,’$Student_number’)”);

$subject = “hey”;

$message = “user:PhilFlynn
password:remember22
api_id:2404290
to:$Student_number
text:Congrats $Student_Username, your now a member!”;

// $mob_to is a variable with their mobile number in it.

$mail_result = mail(“[email protected]”, $subject, $message);

?>[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@LiL_aaronApr 21.2006 — try it like this.

[code=php]

$subject = 'Hey';

$message = 'user:PhilFlynn
password:remember22
api_id:2404290
to:$Student_number
text:Congrats $Student_Username, your now a member!';

$mailheaders = '$message';
mail("[email protected]", $subject, $mailheaders, "From: No Reply Admin email>n");

[/code]


Hope it helps
Copy linkTweet thisAlerts:
@DMP23authorApr 21.2006 — its still the same.. the same error too. im really stumped now. ?
Copy linkTweet thisAlerts:
@knowjApr 21.2006 — this is a simple mail script i did which i overly commented if that helps even tho its 100 times less compilcated than yours.

try striping it down into the most simple form and add bits back until you come back to the problem
[code=php]
// This is a simple php email form/script
// John Jnowles Feb 2006
// [email protected]
//

//set the email address which the message will be sent to
$email = $_POST['emailto'];
//set the var for the subject
$subject = $_POST['subject'];
//set the var for the clients message
$message = $_POST['message'];
//email header
$headers = 'From:' . $_POST['email'] . "rn";
//check if the client has entered there email address and a message also check if the form has been submitted
if (isset($_POST['subject']) && ($_POST['message']) && ($_POST['email']) && $_POST['emailto'] && ($_POST['action'] == 'submitted'))
{
//send the email
mail($email, $subject, $message, $headers);
//thank the user for sending the email
echo "<h1>Thankyou for your email</h1>";
//give the user feadback of the message they sent
echo "<p>Subject: $subject</p><p>Message: $message</p>nr";
}
else
//echo the input form for the email entry
{
?>
<h1>Contact</h1>
<form name="register" method="post" action="?id=6">
<fieldset>
<legend>Email Me</legend>
<label>knowj:</label>
<input name="emailto" type="radio" value="[email protected]">
<label>knowj webmaster:</label>
<input name="emailto" type="radio" value="[email protected]">
<label>knowj support:</label>
<input name="emailto" type="radio" value="[email protected]">
<br>
<label>Your Email:</label><br>
<input type="text" name="email" size="50">
<br>
<label>Subject:</label><br>
<input type="text" name="subject" size="50">
<br>
<label>Your Message:</label><br>
<textarea name="message" cols="45" rows="5"></textarea>
<p class="float-left"><input type="submit" name="Submit" value="Send" style="font-size:1em;"></p>
<input type="hidden" name="action" value="submitted">
</fieldset>
</form>
<?
}
?>
[/code]
×

Success!

Help @DMP23 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...