Re: Server cannot send emails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 16, 2009 at 10:36 AM, Sergio Jovani <lesergi@xxxxxxxxx> wrote:

> Hi!
>
> I have working at SourceForge.net project web space Drupal as CMS. I
> have many modules installed related with email like Contact, Notify...
> This modules never worked and I tried send an email from email php
> function. I did it with:
>
> <?php
> $to = "myemail@xxxxxxxxx";
> $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>");
>  }
> ?>
>
> This does not work too. Is there any issue with email sending from
> SourceForge.net?
>


Looks like you're missing the "From: " part of the email. That's probably
your issue. I never used sourceforge, but I know many hostings require you
to specify a sender.

from http://php.net/manual/en/function.mail.php

 <?php
$to      = 'nobody@xxxxxxxxxxx';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@xxxxxxxxxxx' . "\r\n" .
    'Reply-To: webmaster@xxxxxxxxxxx' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>



Thiago Henrique Pojda
http://nerdnaweb.blogspot DOT com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux