Jump to content

Need help with PHP mail(linux)


timeline

Recommended Posts

hi friends,

 

iam developing a php application in linux to send mail

 

i have got the smtp host account from a open source mail client.

 

in windows if we want to send a mail using php we can edit the php.ini file in the server & add the smtp host name etc.,

and we can use the mail function in php to send the mail

 

In linux, i have no idea, how to configure the smtp settings etc., & wat php functions can b used to send the mail ???

 

so please reply me with the list of methods & steps to configure the mail in Linux

 

thank u ?? :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/106918-need-help-with-php-maillinux/
Share on other sites

If it is like most Linux boxes, it should have sendmail installed on it.  If that is the case, you should just be able to use the built in mail() command from php.  Have you tried that?

 

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Someone <[email protected]>\r\n";

$subject = "Put subject here";

$message =  "<br> Put your message here. ";

$to = "[email protected]";

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

 

You can specify who it comes from via the headers and this also controls the 'reply to address' (see the 'From line in the headers variable).  I realize that you wanted help setting up the smpt settings, but I thought this might be a bit easier if you haven't already tried this.  My apologizes if you already have.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.