post your comment   print   send to a friend
Rate:  75% | Views: 1099
Question categories:  Shared Hosting

how can i send emails using a php script with my shared hosting plan?

Answer by: George Kaloyanov, Aplus.Net Knowledge Base Support

You can send emails off the shared hosting server using the built-in mail() function of PHP.

The required parameters of the mail() function are:

  • The Recipient’s Email Address.
  • The Email Subject.
  • The Email Message Content.

We strongly recommend that you insert custom headers in order to define the Sender’s Email Address too. Although this is not required, it is always a good idea to define the real sender of the email. If you define the real sender, your recipients will be able to reply to your emails sent through the php script. Otherwise, the recipient will not be able to see the real sender, thus not able to reply to you.

Example: mail($to, $subject, $message, $headers)

Here is the whole php script example:

<?php

$to= 'recipient@example.com';

$subject='your subject';

$message='hello';

$headers='From: sender@yourdomain.com';

$result=mail($to, $subject, $message, $headers);

if (!$result){

die('Email Message Not Sent');

}

echo 'Email Message Sent';

?>

Related links:

Customer Feedback
Rate:  75% | Views: 1099 | Please Rate:  
 
If you have other comments or ideas for future technical tips, please type them here:

Email: (optional)

Comments: (optional)

 Email Hosting | Server Hosting    Back to serch results
Browse the Base
Knowledge Base
Shared Hosting
  Legacy Hosting Plans
  Unix Plans
  NT Plans
  Email
  SSL
  Fiberia
Messages
 

$75 Free Google AdWords

Free $75 Google AdWords when you sign up for WebImage! Target by location, create your own, or let Google create your ads for you. Check out http://www.aplus.net/google.html to see how AdWords works for you.

Private Area
 
Ask
in Private
   
Personal
Folder
 
Related Questions
 
1. What does the Archive Manager tool do?
 
2. How can I archive a directory from my web-hosting?
 
3. What is the use of the File Manager tool?
 
4. What is the meaning of Owner, Group and Everyone in the permissions panel?
 
5. How to Redirect URL?
 
Home Browse Search Ask in Private Personal Folder   Help
powered by web hosting 
  Logged as: Guest