Jump to content

PHP Mail


ChaosKnight

Recommended Posts

Okay, so I have a script for a "contact us" form that inserts an entry in the database (which works), but because this a brand new system for the company, they requested that for the first few months they also want to receive a similar e-mail message...

 

I never actually used PHP Mail before, seeing that I like the functionality of the database more...

 

Here is a code snippet of the action for the form that I wrote:

<?php
  if (isset($_POST['name']) && isset($_POST['email'])){
    $email_to = $mail_address;
    $email_msg = $_POST['message'];
    $email_subj = $_POST['subject'];
    if(mail($email_to,$email_subj,$email_msg)) {
      echo("<h3>Message successfully sent...</h3>");
    }else{
      echo("<h3>Message could not be delivered...</h3>");
    }
  }
?>

 

But when I try to send it, it fails...

 

I contacted the client's shared hosting company, but they said that they didn't have any PHP

mailing support but I can write a custom script that includes the SMTP address and password,

etc.

 

My question is:

  How can I set this up and send an email message that works?  :wtf:

 

Any help would be greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/200312-php-mail/
Share on other sites

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.