Help a newbee save my job !
Posted on
16th Feb 2014 07:03 pm by
admin
Hey guys i am dying here i am new to php and would like for someone to help me with this problem
i have a script that send information from a "form" but the probelm is that i need this to be autheticated (smtp) before sending the email.
Did you know?Explore Trending and Topic pages for more stories like this.
here is the script that i am using: (If you know what i need to do to authenticate this smtp please HELP ME!)
<?php
$emailmanager = 'oscarm@crystalplace.com';
error_reporting(0);
$msg = '';
foreach ($_POST as $k => $v) { $msg .= $k.': '.$v."nn"; }
$email = trim($_POST['email']);
$Ok = ereg("^([a-zA-Z0-9_.-]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$", $email);
$headers = 'From: ' . $email . "n";
$headers .= 'MIME-Version: 1.0' ."n";
$headers .= 'Content-Type: text/plain; charset=iso-8859-1' ."n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "nn";
if ($Ok) {
mail($emailmanager,'New Trade Form Request from Brilliante Crystal Cleaner',$msg,$headers);
?>
<script language = 'javascript'>
alert('Thank you For Submiting Your Application ---> Brilliante Crystal Cleaner Team <---');
window.close();
</script>
<?
} else {
?>
<script language = 'javascript'>
alert('Sorry, please complete the form.');
history.go(-1);
</script>
<?
}
?>
No comments posted yet
Your Answer:
Login to answer
129
49
Other forums
email CODING Problem
Email coding problem.
I need to send a section of the info to $tf and the same as a Cc to $em
Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does
explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc
Not capturing all the information we require in the form.......
Hi Guys,
I was wondering if you would share some more of your knowledge today, I'm hoping it
Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...
The coeffi
Saving PHP output as a file
I wondered if anyone knows how to save the rendered output of a PHP script as a file?
I have
Help with form post data and arrays
Hi all,
I am new to this forum... It has been awhile since i have worked with arrays, and i a
Take info from one coloum and move to another
Hi all,
I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_
multipart emiail forms
Hi All,
I am new to the boards and I've been working on a form (which is rather massive, imo
Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as