Jump to content

PHP mail not working :P Been trying to fix it for over a month now...


bloodl

Recommended Posts

Hi,

 

I am trying to get my clients email up and working.  It sends the vars from flash, and I never hear a peep out of the php.  No errors, and no emails !

The vars are correct on both sides, and apparently this form works on other sites.

 

my php.ini is set up:

 

[mail function]

; For Win32 only.

SMTP = mail.mydomain.com

smtp_port = 25

 

; For Win32 only.

sendmail_from = theboss@myworkplace.com

 

If anyone can see the dodge within this code, can you plez help me out?

 

<? 

 

$adminaddress = "milk@visuality.com.au";

$siteaddress ="www.visuality.com.au";

$sitename = "Visuality";

 

//Gets the date and time from your server

//$date = date("m/d/Y H:i:s");

 

// Gets the IP Address

if ($REMOTE_ADDR == "") $ip = "no ip";

else $ip = getHostByAddr($REMOTE_ADDR);

 

// Gets the POST Headers - the Flash variables

$action = $_POST['action'] ;

$firstname = $_POST['firstname'] ;

$lastname = $_POST['lastname'] ;

$email = $_POST['email'] ;

$phone = $_POST['phone'] ;

$time = $_POST['time'] ;

$how = $_POST['how'] ;

$promo = $_POST['promo'] ;

 

//Process the form data!

// and send the information collected in the Flash form to Your nominated email address

 

if ($action == "send") {

//

mail ("$adminaddress","Website Contact",

"A visitor at $sitename has left the following information\n

------------------------------

First Name: $firstname

Last Name: $lastname

 

Time: $time

Phone: $phone

Email: $email

Promo: $promo

How: $how

 

Logged Info :

------------------------------

Using: $HTTP_USER_AGENT

Hostname: $ip

IP address: $REMOTE_ADDR

Date/Time:  $date","FROM:$adminaddress" ) ;

 

//This sends a confirmation to your visitor

mail ("$email","Thank You for visiting $sitename",

"Hi $firstname,

 

Thank you for your interest in $sitename!

We will get back to you as soon as possible.

 

 

Cheers,

$sitename

------------------------------

Phone: (02) 1234567899

$siteaddress","FROM:$adminaddress") ;

 

//Confirmation is sent back to the Flash form that the process is complete

$sendresult = "Thank you.";

$send_answer = "answer=";

$send_answer .= rawurlencode($sendresult);

echo $send_answer;

} //

 

 

?>

 

Cheers,

Doug

 

Link to comment
Share on other sites

use this to send your self an email then tell me if it works please ok.

 

<?php
$to = 'bob@barnyard.com';
$subject = 'Wakeup bob!';
$message = '<b>yo</b>, whassup?';
$headers = "From: server@barnyard.com\r\n" .
        'X-Mailer: PHP/' . phpversion() . "\r\n" .
        "MIME-Version: 1.0\r\n" .
        "Content-Type: text/html; charset=utf-8\r\n" .
        "Content-Transfer-Encoding: 8bit\r\n\r\n";

// Send
mail($to, $subject, $message, $headers); 
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.