Jump to content

kross

Members
  • Posts

    8
  • Joined

  • Last visited

kross's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I figured it out... Using PuTTy, I logged into my server and a message popped up saying that new "security" feature was added to the servers and that email can only be sent to addresses provided by school. no personal email addresses are allowed anymore. Thanks for your help guys!
  2. if there actually is something wrong with my server, what kind of tests or actions can I perform to find out for sure?
  3. its a server provided to me by my school it has my own login and is password protected
  4. It returned "Email Sent" but I didnt recieve an email. I even waited a few minutes I checked spelling, resent, and tried different addresses, but still wont work
  5. just that code by itself in its own file?
  6. I'm sorry, but was I supposed to plug that into my existing code or run that by itself essentially? I plugged it into mine and I think I'm getting a syntax error because the page is completely blank when I load it. This is what I did <?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if(isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else { //send email $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; if(mail("someone@example.com", "Subject: $subject", $message, "From: $email" )) { echo "Message sent. Thank you!"; } else { echo "Message Not sent. Sorry."; } else //if "email" is not filled out, display the form { echo "<form method='post' action='contact.php'> What's your name? <br /> <input name='name' type='text' required /> <br /> What's your Email address? <br /> <input name='email' type='text' required> <br /> What is the matter regarding? <br /> <input name='subject' type='text' required> <br /> What is your message? <br /> <textarea name='message' rows='10' cols='25' required></textarea> <br /> <br /> <input type='submit' value='Send'> </form>"; } ?>
  7. yeah I'd like to know why my code doesnt work... but thank you! I appreciate it
  8. Hello everyone.. I know next to nothing about PHP but I'm trying to set up a mail form on a html web page. The code I've used should work, but for some reason the email wont send. When I hit send, the message pops up saying that it sent, but it doesnt send. What am I missing or doing wrong? Here's the code <?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else { //send email $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("someone@something.com", "Subject: $subject", $message, "From: $email" ); echo "Sent. Thank you!"; } } else //if "email" is not filled out, display the form { echo "<form method='post' action='contact.php'> What's your name? <br /> <input name='name' type='text' required /> <br /> What's your Email address? <br /> <input name='email' type='text' required> <br /> What is the matter regarding? <br /> <input name='subject' type='text' required> <br /> What is your message? <br /> <textarea name='message' rows='15' cols='50' required></textarea> <br /> <br /> <input type='submit' value='Send'> </form>"; } ?> Keep in mind that the someone@something.com is not the email I tried sending it to. I've tried multiple email accounts I have on yahoo and gmail with no luck. And yes, the file is saved in a folder on a server that has php installed. Thank you for your time!!!
×
×
  • 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.