• 0

Flash/php mail form problem


Question

Hi..

apologies if this is in the wrong section but I need some help with my php script.

When submitting the form on the flash file, I get a message that the mail has been sent successfully but no email turns up. Everything used to work perfectly but when my I stopped receiving emails, I thought I would test things out.

Here's the action script code on the submit button:

on (rollOver) {
	this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
	this.gotoAndPlay("s2");
}
on (release) {
    if (this._parent.your_name eq "Name:" or this._parent.your_email eq "E-mail:" or this._parent.telephone eq "Phone:" or this._parent.message eq "Message:") {
    this._parent.EmailStatus = "Please fill in all of the required fields....";
    }
    else if (!this._parent.your_email.length || this._parent.your_email.indexOf("@") == -1 || this._parent.your_email.indexOf(".") == -1) {
    this._parent.EmailStatus = "Please enter a valid E-mail address....";
	} else {
	this._parent.EmailStatus = "Sending message.  Please wait....";
	sender_name = this._parent.your_name
	sender_email = this._parent.your_email
	sender_phone = this._parent.telephone
	sender_message = this._parent.message
	loadVariables("/Scripts/sendmail.php",this,"POST");
}
}

And here's my php script:

<?
$sender_email = $_POST['sender_email'];
$sender_phone = $_POST['sender_phone'];
$sender_message= $_POST['sender_message'];
$sender_name= $_POST['sender_name'];

$ToEmail = "my@email.address";

$ToName = "My Name";
$ToSubject = "$sender_name has sent you a message from your website";

$EmailBody = "\nEmail: $sender_email\nPhone Number: $sender_phone\nMessage: $sender_message";

$EmailFooter="\n";

mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$sender_name." <".$sender_email.">", '-f my@email.address');


Print "_root.cont.cont2.txt.EmailStatus= Message sent successfully. Thank you :)";

?>

I've changed the email address in the php code.

As I said previously, all appears to work perfectly. If I omit fields from the contact form, the action script comes up with the message to tell me to complete all fields or use a valid email address and when the form is complete, it seems to communicate with the php script as I get the message that it was sent...but still no email.

If someone here can advise me on anything to check, that would be cool.

Thanks for reading :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

What's your website's control panel? cPanel has a default 'catchall' address that you can check.. From there you can normally find out why the email is being sent as you'll see the bounceback message there.

For example on a site of mine.. I noticed that Yahoo registrations on IPB weren't being validated, so in order to check out what was happening, I viewed the default catchall email to find this:

 Return-path: <>
Envelope-to: <<redacted>>
Delivery-date: Tue, 07 Sep 2010 18:03:55 -0400
Received: from mailnull by<<redacted>> with local (Exim 4.69)
    id 1Ot6Gh-0004PR-25
    for<<redacted>>; Tue, 07 Sep 2010 18:03:55 -0400
X-Failed-Recipients: <<redacted>>@yahoo.com
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@<<redacted>>>
To: <<redacted>>
Subject: Mail delivery failed: returning message to sender
Message-Id: <<redacted>>
Date: Tue, 07 Sep 2010 18:03:55 -0400

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  <<redacted>>@yahoo.com
    SMTP error from remote mail server after initial connection:
    host f.mx.mail.yahoo.com [98.137.54.237]: 421 4.7.1 [TS03] All messages from <<redacted>> will be permanently deferred; Retrying will NOT succeed. See http://postmaster.yahoo.com/421-ts03.html:
    retry timeout exceeded

Found out that the reason members with Yahoo emails weren't validating their account was due to Yahoo blocking my server's IP address due to lacking SPF records.

A lot of times a server that is using PHPSuexec will have PHP mail scripts send mail out as "nobody" (or the server) and most mail services will reject the email if it does not pass their standards. What email provider are you using?

Link to comment
Share on other sites

  • 0

Thanks for the reply Cupcakes.

The contact form isn't from a forum or anything like that...it's just my personal dj website. I'm not sure if this is in the right section of the forum though?

Anyway...i've tinkered a bit with the php script and i've managed to get it working with this:

<? 
$sender_email = $_POST['sender_email']; 
$sender_phone = $_POST['sender_phone']; 
$sender_message= $_POST['sender_message']; 
$sender_name= $_POST['sender_name']; 

$ToEmail = "My Email Address"; 

$ToName = "My Name"; 
$ToSubject = "$sender_name has sent you a message from your website"; 

$EmailBody = "\nEmail: $sender_email\nPhone Number: $sender_phone\nMessage: $sender_message"; 

$EmailFooter="\n"; 

mail($ToEmail, $ToSubject, $EmailBody, "From: ".$sender_name." <".$sender_email.">", '-f My Email Address); 

Print "_root.cont.cont2.txt.EmailStatus= Message sent successfully. Thank you :)";

?>

Seems weird that it used to work perfectly with the original code but not any longer....perhaps the host have updated things their end?

Anyway, thanks again for the reply :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.