Welcome Guest, Not a member yet? Register   Sign In
Anyone can help PLEASE in the code of PHP send e-mail i have tried everything but when don´t receive any e-mail i believ
#1

[eluser]IronAngel[/eluser]
Hello below i paste the PHP send i need help because i don´t know were i do wrong:



<?PHP

if (!get_magic_quotes_gpc()) {
foreach($_POST as $key=>$value) {
$temp = addslashes($value);
$_POST[$key] = $temp;
}
}

// ADD YOUR EMAIL HERE //
$to = ‘[email protected]’;
// VARIABLE NAME FROM FLASH //
$name = ‘Name: ‘.$_POST[‘name’];
// VARIABLE EMAIL FROM FLASH //
$email = ‘Email: ‘.$_POST[‘email’];
// VARIABLE TELEPHONE NUMBER FROM FLASH //
$telephone = ‘Telephone Number: ‘.$_POST[‘telephone’];$subject =‘ZERO Y CONCTACT FORM:’.$_POST[‘subject’];
// VARIABLE MESSGAE FROM FLASH //
$message = $_POST[‘message’];
$additionalHeaders = “From: [email protected]\n”;
$additionalHeaders .= “Reply-To: “.$_POST[‘name’].”<”.$_POST[‘email’].”>\n”;
// RECEIVED MESSAGE FROM WHICH YOU CAN CHANGE TO YOUR OWN //
$messagetosend = ‘You have recieved an email via your website from:’.”\n\n”;
$messagetosend .= $name.”\n”;
$messagetosend .= $email.”\n”;
$messagetosend .= $telephone.”\n\n”;
$messagetosend .= ‘Here is the message:’.”\n\n”;
$messagetosend .= $message.”\n\n”;
/// REPLY MESSAGE WHICH YOU CAN CHANGE TO YOUR OWN //
$messagetosend .= ‘You can reply to this mesage to respond’.”\n\n”;


$OK = mail($to, $subject, stripslashes($messagetosend), $additionalHeaders);
//
if ($OK) {
$flashreply = ‘Email Message Sent’;
echo ‘sentSuccess=’.urlencode($flashreply);
} else {
}

?&gt;






First i have put the e-mail address in the php, didn´t work, second i have changed these codes:

$additionalHeaders = “From: [email protected]\n”;
$additionalHeaders .= “Reply-To: “.$_POST[‘name’].”<”.$_POST[‘email’].”>\n”;

Don´t work i click the button send give the response that tha e-mail was sent sucessefuly i check the e-mail i don´t receive anything.

I don´t know what i can do to make it work, i need help someone to give me the right direction and help me to solve this problem.

Thank you.
#2

[eluser]Make Code& Love Code[/eluser]
Hi !!!
Are your running this code in Localhost or in Server ?? Have you checked your server/localhost configuration ?? I think you need to check your configuration if u didn't ??
#3

[eluser]CroNiX[/eluser]
This person already posted this in another thread. They don't know what they are doing and just want someone to do it for them.
#4

[eluser]IronAngel[/eluser]
Hello and i´am very thankfull for all the help i can receive.

Summer Student no i didn´t check i will check it, thank you for your precious help.

Lab Technician i need to say i don´t want anyone to make the things for me i want to learn and another i´m capable of doing my self.

I ask because i don´t any one who can help me.

If someone give me the right directions i go there i will make mistakes i will ask untill i learn.

This is my first time making these i know that i have done something wrong the only i ask is someone who can give me the right directions i will follow it doing may self i want to learn.

Thank you once again.
#5

[eluser]InsiteFX[/eluser]
I did give you the right directions in the other forum topic you posted!

Use the CodeIgniter Email Class Library...

And I think you should sit down and take the time to read the CodeIgniter Users Guide!
#6

[eluser]aquary[/eluser]
They already gave you advices, but you haven't tried follow it...

again, READ the USERGUIDE for EMAIL CLASS.

btw, their name are not "Lab Technician" nor "Summer Student"...
#7

[eluser]IronAngel[/eluser]
Hello,

Thank you for your reply.

I have read the Userguide for Email Class. Like i have told it´s my first time i i´m trying doing this by my self.

Once again Thank you for all the help you are giving me.

My mistake and sorry to Make Code& Love Code and CroNiX.

Thank you.
#8

[eluser]CroNiX[/eluser]
If you have tried using the CI email class and having problems, post that code. People will help. But, so far, you have only posted some regular php for emailing that does not use the codeigniter email class (or any other CI code) so it makes it look like you haven't tried anything new or actually tried to use codeigniter.
#9

[eluser]IronAngel[/eluser]
Thank you to all who help me Make Code& Love Code, CroNiX, InsiteFX and aquary.

The problem i have is find a solution in the language i want, using SMTP authentication.

I have found this:

&lt;?php
require("smtp.php");
require("sasl.php"); //SASL authentication
$from="[email protected]";
$smtp=new smtp_class;
$smtp->host_name="www.website.com"; // Or IP address
$smtp->host_port=25;
$smtp->ssl=0;
$smtp->start_tls=0;
$smtp->localhost="localhost";
$smtp->direct_delivery=0;
$smtp->timeout=10;
$smtp->data_timeout=0;
$smtp->debug=1;
$smtp->html_debug=1;
$smtp->pop3_auth_host="";
$smtp->user="support@website.com"; // SMTP Username
$smtp->realm="";
$smtp->password="password"; // SMTP Password
$smtp->workstation="";
$smtp->authentication_mechanism="";

if($smtp->SendMessage(
$from,
array(
$to
),
array(
"From: $from",
"To: $to",
"Subject: $subject",
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
),
"$message"))
{
echo "Message sent to $to OK.";
}
else
echo "Cound not seend the message to $to.\nError: ".$smtp->error;
?&gt;

I believe it´s good.

#10

[eluser]CroNiX[/eluser]
You still aren't even trying to use codeigniters BUILT IN email class? Why even bother using codeigniter if you aren't going to use its built in features?
3rd Time: User Guide: Email class




Theme © iAndrew 2016 - Forum software by © MyBB