PHP send email help - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-06-2011, 12:13 PM   #1 (permalink)
Junior Member
 
Join Date: May 2011
Posts: 1
Default PHP send email help

I'm using this script to send myself an email but for some reason it doesn't work.
Is something wrong with it or do you need special software to send a PHP email? My webhost is ripway.com btw.

Code:
<?php
 $to = "my@email.com";
 $subject = "Hi!";
 $body = "Hi,\n\nHow are you?";
 if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
 ?>
Legiondary is offline   Reply With Quote
Sponsored Links
Old 05-08-2011, 11:22 AM   #2 (permalink)
Regular User
 
Join Date: Apr 2011
Posts: 115
Default Re: PHP send email help

Check from your hosting provider, wether the mail function is enabled or not.
The providers, often like to keep that service off, to check spamming, which otherwise, may overload their servers.
If that is the case, you can use SMTP to send mails or can use curl
chunnilal is offline   Reply With Quote
Old 05-11-2011, 04:13 AM   #3 (permalink)
Junior Member
 
Join Date: May 2011
Posts: 56
Default Re: PHP send email help

Yes Check Hosting provide i m try many time to send mail to register user but Godadday not allow :P Mybb forum




Thank you

----------------------
Fuel Pump

Last edited by bubblesdavid1Backtous1; 05-11-2011 at 04:31 AM.
bubblesdavid1Backtous1 is offline   Reply With Quote
Old 05-12-2011, 01:02 AM   #4 (permalink)
Junior Member
 
Join Date: Apr 2011
Posts: 57
Default Re: PHP send email help

Thank you for your sharing ,i will visit it later
pread is offline   Reply With Quote
Old 05-04-2012, 06:28 PM   #5 (permalink)
Regular User
 
Join Date: May 2012
Posts: 16
Send a message via Skype™ to fromfeed.com
Default Re: PHP send email help

You can use this. It is perfectly working.

Quote:
$receiverEmail = "info@example.com";/*Destination email address*/
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: $name <$email>\r\n";

$mails = $funObj->sendEmail($name, $email, $receiverEmail, $subject, $message, "", false);
if($mails)
{
echo "Email is succesfully Delivered";
}
else
{
echo "<br/>Email is not Delivered";
}
fromfeed.com is offline   Reply With Quote
Old 05-14-2012, 05:31 AM   #6 (permalink)
Regular User
 
Join Date: May 2012
Location: usa
Posts: 18
Default Re: PHP send email help

Quote:
Originally Posted by fromfeed.com View Post
You can use this. It is perfectly working.
$receiverEmail = "info@example.com";/*Destination email address*/
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: $name <$email>\r\n";

$mails = $funObj->sendEmail($name, $email, $receiverEmail, $subject, $message, "", false);
if($mails)
{
echo "Email is succesfully Delivered";
}
else
{
echo "<br/>Email is not Delivered";
}
i'm sure that your php script can't work .
$mails = $funObj->sendEmail($name, $email, $receiverEmail, $subject, $message, "", false);
. where do u declare object $funObj ?
y8games2012 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:43 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting