Jump to content

Cant send email.. help !!


alvinchua

Recommended Posts

hi ppl .. i wish to send email through php.. if can .. i wan to send emails to hotmail and yahoo mailbox ... i have a web hosting service that host php file (means that i have host the file on it and not localhost) .. and they provide me the email feature too where i tried to send to those email also.. but all the mails i sent to (either hotmail or yahoo or provided emails) do not appear in thier inboxes .. pls help .. and here my code..

 


<?php

$errorMessage = '';
if (isset($_POST['name']) && isset($_POST['email']) &&isset($_POST['message'])) 
{
$name = $_POST['name'];
$email =$_POST['email'];
$message = $_POST['message'];
$to = "alan@domain.com";

mail($to, "Customer Enquiry", "Name: $name \n\n Enquiry: \n\n $message", "From: $email");

echo("<p>Message successfully sent!</p>");
echo $name;
echo $email;
echo $message;
echo $to;
}
else {
echo("<p>Message delivery failed...</p>");
}

?>

 

Thank in advance..

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.