12 2611
Just run this in a new php file to see if your mail is configured correctly: (remember to put your email in the $to, and also check your spam box) - <?php
-
$to = "recipient@example.com";
-
$subject = "Email test";
-
$body = "Testtesttest";
-
if (mail($to, $subject, $body)) {
-
echo("<p>Message successfully sent!</p>");
-
} else {
-
echo("<p>Message delivery failed...</p>");
-
}
-
?>
Thats very similar to the "mini" script I wrote and tested with, but I ran yours anyways. Same thing it sent, and I received, so it has to be something in the mail.PHP script itself.
Thanks for your replay
Try: - <?php
-
//Type the receiever's e-mail address
-
$emailAddress = "brian@sbsitedesigns.com";
-
//Type your Site Name
-
$siteName = "SBSiteDesigns.com";
-
-
$contact_name = $_POST['name'];
-
$contact_email = $_POST['email'];
-
$contact_subject = $_POST['subject'];
-
$contact_message = $_POST['message'];
-
-
/* -- Test -- */
-
echo "Contact Name: $contact_name< br/>";
-
echo "Contact Email: $contact_email< br/>";
-
echo "Contact Subject: $contact_subject< br/>";
-
echo "Contact Message: $contact_message< br/>< br/>";
-
-
if( $contact_name == true ) {
-
$sender = $contact_email;
-
$receiver = $emailAddress;
-
$client_ip = $_SERVER['REMOTE_ADDR'];
-
-
$email_body = "The Name Of The Sender: $contact_name \nEmail: $sender \n\nSubject: $contact_subject
-
\n\nMessage: \n\n$contact_message \n\nIP ADDRESS: $client_ip \n\n$siteName";
-
-
$emailAutoReply = "Hi $contact_name, \n\nWe have just received your E-Mail. We will get
-
in touch in a few days. Thank you! \n\n$siteName ";
-
-
$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
-
$autoReply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();
-
-
/* -- Test -- */
-
echo "Email Body: $email_body< br/>";
-
echo "Auto Reply Email: $emailAutoReply< br/>";
-
echo "Extra: $extra< br/>";
-
echo "Auto Reply: $autoReply< br/>";
-
-
-
-
-
mail( $sender, "Auto Reply: $contact_subject", $emailAutoReply, $autoReply );
-
-
if( mail( $receiver, "New E-Mail - $contact_subject", $email_body, $extra ) ) {
-
echo "success=yes";
-
} else {
-
echo "success=no";
-
}
-
}
-
?>
I have just put in some echo's at some points to see if your variables are what you expect. I am hoping it's something easy like $_POST not being sent correctly.
Out of interest, does your Auto Reply mail work? Or are both emails not working?
Well its not as easy as I'd hoped. It's down right frustrating! That code you gave me didn't work. To answer your question (first thanks for your help!) I'm not receiving the auto reply or the notification e-mail
What do you mean it didn't work? There was no output?
If so, then I'm going to guess it's how you're calling the script.
The last script that you gave me didn't send me a reply or notification. I have checked and rechecked the actionscript and I'm at a loss. I guess I'll have to just use another script. Thanks for your help.
I put in a bunch of echo's to see if it was everything you expected. Did none of those print?
What I did to the actionScript is add a getURL to the end of it and pointed it to the email.php page.
This is the result I got.
Contact Name: < br/>Contact Email: < br/>Contact Subject: < br/>Contact Message: < br/>< br/>
So basically nothing.
I tested the email PHP which you had posted earlier and it was all fine. Recieved email.
The only problem I think is the actionScript posting the variables to the email.php
Can you help mate?
You should turn on error-reporting. -
// At the very top of your code
-
error_reporting(-1);
-
ini_set('display_errors', 1);
-
Where would I see these errors?
I think it's the flas ActionScript posting to the PHP which is the problem.
I can't get around how to fix it though.
I fixed the problem. Apparently in the AS line 69 there was a function which didn't allow the sending of data gotoAndstop(2);
so I added a this function so it would send the data and when it received confirmation from the server it would stop. - _parent.contactform.loadVariables("email.php", this, "POST");
-
this.onData = function() {
-
gotoAndStop(2);
-
};
Hi Namik,
Can you please let me know how you get it to work? Cuz i tried copy the part you added and i was never able to get the button submit to activate. If you could post up the entire code that is working for you that would be very helpful.
thanks
john
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Web Master |
last post by:
Hi,
I am having a little issue with Jacks Form mail php script. I have
installed it and configured the form to get it to work, but for some
bizarre reason I have 2 issues I can't seem to debug....
|
by: trend5 |
last post by:
I have a simple mail script designed to use from command line.
I want create a simple web interface to use this script as remotely
hosted webscript, from webhost.
The script contains two files-...
|
by: Steve Richter |
last post by:
How does the following javascript work? After the first script runs the
variables "sGeobytesCity", "sGeobytesRegion" and "sGeobytesCountry"
contain values that have been set somehow by the...
|
by: steve |
last post by:
I'm trying to create a PHP script to send mail to a list of addresses.
I'm sending mail okay, because the messages arrive in an account that I
can check, but messages to a known bad address aren't...
|
by: Chuck W. |
last post by:
So I have a very simple mail script just to send a quick 'n dirty
notification of a form posting -- it goes like this:
$message = $_POST . "\", first_name = \"".
$_POST . "\",last_name = \""....
|
by: shror |
last post by:
dear all,
i have started learning php 2 weeks ago and i have wrote my first
script for mail sender and the script takes all my data and move to
the thanks page but the problem is that the mails...
|
by: chunk1978 |
last post by:
hi there... i would like to know if anyone could look at my mail script and tell me if there is anything clearly wrong, or missing...
<?php
$to = $_POST;
$subject = 'test';
$random_hash =...
|
by: DVH |
last post by:
Hi,
I've a script that sends mail from my site.
I've included a regexp which should return 403 forbidden if you try to
hijack it and send to another address.
How can I test to make sure it...
|
by: Joe Demeny |
last post by:
I am looking for a python web form to mail script for a public web site -
could you recommend one?
--
Joe Demeny
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |