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
ALV sum various columns problem
Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is s
Weird Problem with curl while sending data
I am facing a weird problem with sending data to a site via curl.
If i send the value by this
Calculating n! using vector
#include
#include
#include
using
Pagination won't carry results past page 2.
Hi all,
I've worked out my pagination script and its paginating fine until I click next from
Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",
session_destroy();
new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 i
Displaying data from database into a 2 dimensional table
Good day!
I'm a beginner in PHP and I'm not expecting a full coding for this qestion. I'm jus
mail() problem
Hi Guys,
I've set up a contact email form. It sends the information fine, but it sends it to
Pagination
Hi All,
I think I'm finally getting somewhere with pagination!
I can now submit a quer
Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?