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.

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 Like 49 Dislike
Previous forums Next forums
Other forums

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possibl

DataTable Help Required
Hi all I am creating an app that utilises and MS Access back end and queries it quite a bit at vario

Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be

Dynamically set AccordianPane Header
I have an accordian on my master page. I'd like to be able to dynamically change the header on diff

extract content from a website
i have written a code that will grab the content from the index page..
i would like to know how c

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash