Jump to content

How to send mail


lhbdan

Recommended Posts

I think this is what i'm using at work for production equipment to send status info.

 

In php.ini do the following:

[mail function]

; For Win32 only.

SMTP = mail.subdomain.domain.org    <<<----  fix this line, get it from your email program

smtp_port = 25

 

 

 

; For Win32 only.

sendmail_from = [email protected]    <<<- fix the sent from address.

 

 

 

 

 

Restart Apache.

 

 

 

 

 

Here’s the php code.

<?php

$to = "[email protected]";

$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>");

}

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/230848-how-to-send-mail/#findComment-1188967
Share on other sites

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.