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