Jump to content

PHP Email Streamline.net Nightmare.....Please PLEASE help!!


Rowan May

Recommended Posts

Hi there,

I am pretty new to the whole web world, but have been teaching myself flash backwards from Templates i purchased from Active Den. I have asked the authors for help but with no luck, and streamline, as i have read in your forums are also a pain in the proverbial, and i have tried to use the changes inpmemented by other people asking similar questions here, also with no luck. I can't afford to switch hosts...so I have turned here in desperation. I hope that some genius will come to my rescue...

I have 2 elements in my site which use PHP to send emails:

1) Action script 2 form which sends an email co confirm joining the mailing list.

2) Action script 2 form which sends multiple choices of email in my contact us section

 

The second is the most important. I can remove the first from the site if it makes no sense...lots of code...

 

When i click send on all of them, flash confirms that it has worked, but i receive no email.

 

I have attached the php files, but the PHP codes follow here, if that makes it easier:

1)

<?php

// include the Database classes

require_once('variables.php');

$db = new Database($dbhost,$dbusername,$dbpassword,$dbdbname);

//

// escape quotes and apostrophes if magic_quotes_gpc off

if (!get_magic_quotes_gpc()) {

  foreach($_POST as $key=>$value) {

    $temp = addslashes($value);

    $_POST[$key] = $temp;

    }

  }

$verificationstring = "abcdefghijklmnopqrstuvwxyz0123456789";

$repeat = 0;

$rand = rand(1,500);

while ($repeat <= $rand)

{

$verificationstring= str_shuffle($verificationstring);

$repeat++;

}

$_POST['verify'] = $verificationstring;

// create a Database instance and check username

$sql = 'SELECT user_email FROM mailinglistusers WHERE user_email = "'.$_POST['email'].'"';

$result = $db->query($sql);

$numrows = $result->num_rows;

//

// if email already in use, send back error message

if ($numrows > 0) {

  $duplicate = 'Already Signed Up.';

  echo 'duplicate=y&message='.urlencode($duplicate);

  }

else { // insert the data into the table

  $sql = 'INSERT INTO mailinglistusers (user_name,user_email,user_deletecode)

          VALUES ("'.$_POST['name'].'","'.$_POST['email'].'","'.$_POST['verify'].'")';

  $result = $db->query($sql);

  if ($result) {

    $created = 'Successfully Added';

    echo 'duplicate=n&message='.urlencode($created);

    $to = $_POST['email'];

$bottommessage = '- - - - - - - - - - - - - - - - - - - - - -'."\n\n";

$bottommessage .= 'If you wish to be removed from the mailing list please click the link below.'."\n\n";

$bottommessage .= $siteaddress.'removemaillist.php?code='.$_POST['verify']."\n\n".'- - - - - - - - - - - - - - - - - - - - - -';

$message = $firstmessage.$bottommessage;

$additionalHeaders = "From: ".$firstfromemail."\n";

$OK = mail($to, $firstsubject, $message, $additionalHeaders);

}

}

?>

 

2)

<?php

$to = $_POST['to'];

$subject = 'Website Contact Form: '.$_POST['subject'];

$message = 'From: '."\n".$_POST['from']."\n\n";

$message .= 'Email: '."\n".$_POST['email']."\n\n";

$message .= 'Phone: '."\n".$_POST['phone']."\n\n";

$message .= 'Message: '."\n".$_POST['contents']."\n\n";

$additionalHeaders = "From: ".$_POST[name]."<".$_POST.">\n";

$additionalHeaders .= "Reply-To: ".$_POST;

$OK = mail($to, $subject, $message, $additionalHeaders);

if ($OK) {

  echo 'sent=OK';

  }

  else {

  echo 'sent=failed&reason='. urlencode('There seems to be a problem with the server. Please try later.');

  }

?>

 

Hope there is a PHP god out there that might answer my prayers...

Many thanks

Rowan

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.