Jump to content

How can I detect SMTP?


bobleny

Recommended Posts

How can I detect SMTP? I have a php script that wont send out an email, no errors, so I think the SMTP is disabled? I'm not sure how that part works. This script isn't for me, and I don't know if there server will have the capabilities to send php email. So, before I tell php to send the email, I want to see if it can send an email.

 

So I have a few questions:

1.) How can I detect SMTP settings?

2.) How do I enable or install SMTP?

3.) Is there a way to turn SMTP on from a PHP script?

Link to comment
https://forums.phpfreaks.com/topic/46740-how-can-i-detect-smtp/
Share on other sites

Here, I made this and it doesn't work... I don't know what my ini file calls the SMTP thingy....

 

<?php
if (ini_get('SMTP') == TRUE && $set == "1")
{
$to = "[email protected]";
$subject = "Test";
$message = "This is a test message!";

if (mail($to, $subject, $message))
{
	echo "Sent";
}
else
{
	echo "Error!";
}
}
else
{
echo "Disabled";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/46740-how-can-i-detect-smtp/#findComment-227779
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.