[sf-lug] Sendmail configuration

Doug Bierer doug at unlikelysource.com
Fri Mar 21 21:44:52 PDT 2008


Not sure how you're using PHP ... but here's a code snippet which works:

---------------------------------------------------------
// Send email to verify
$message = "Whatever you want to say.";
$to      = "doug at unlikelysource.com";
$subject = "Test Message";
$headers = 
"From: noreply at unlikelysource.com\r\n" . "X-Mailer: PHP/" .
phpversion();
$body = $message;
$body = wordwrap($body, 12);
	
if (mail($to, $subject, $body, $headers)) {
	$msg_sent = true;
}
--------------------------------------------------------

Notice the use of the $headers variable.  This is where you can program
in the "From" field to put in anything you want.

db

On Thu, 2008-03-20 at 03:37 +0530, Deepan wrote:
> Hi All,
> I am using sendmail via php mail function to send
> emails. However few servers reject my mails with
> the error 'Sender address rejected: Domain not
> found', since mails from my server are sent as
> email at localhost.localdomain. How do I change this
> to a valid domain name ? We only own a public IP.
> we dont really have a domain name, is it possible
> to use IP ? 
> Regards
> Deepan
> Facebook Sudoku Solver:
> http://apps.facebook.com/sudokusolver/ 
> Sudoku Solver: http://www.sudoku-solver.net/ 
> Home Page: http://www.codeshepherd/ 
> 
> 
> 
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug





More information about the sf-lug mailing list