Pear?
Collapse
X
-
Yes, I think after re-applying permissions to various folders getting FTP sorted out and database connectivity fixed plus changing email scripts over we're about there! I admit the paramatised email script is a sensible thing. I also think password authorisation should be introduced on IIS CDO mail forms.
-
Hope you've managed to get your forms all up and running now.
Leave a comment:
-
Originally posted by Phatman View PostThanks Ben, I've now aquainted myself with PEAR, it seemed it all bit arcane at first, I'm still getting to grips with PHP!
Kind regards,
Ben Stones.
Leave a comment:
-
Thanks Ben, I've now aquainted myself with PEAR, it seemed it all bit arcane at first, I'm still getting to grips with PHP!
Leave a comment:
-
Originally posted by Phatman View PostWell PEAR is installed and I can send text emails no problembut when I try to send HTML formatted email using PEARS mime file include I get this error:
"Warning: mail() has been disabled for security reasons in D:\Parallels\Plesk\Additional\PleskPHP5\Pear\Mail\ mail.php on line 153"
The code I'm using is at the top of this here page:
Is there a conflict between PEARS mail class?
Hmmm, I'm now wondering if Swift might have been a better option lol.
Sorry for the late response. The reason being is because of this line:
$mail =& Mail::factory('mail');
The first parameter of the factory() method needs to be "smtp" instead of "mail" in this case, and the second parameter would have SMTP information in an array variable - example:
$smtp_info["host"] = "localhost";
$smtp_info["port"] = "25";
// ...
$mail =& Mail::factory("smtp",$smtp_info);
object &factory ( string $backend , array $params = array() )
The URL I linked to shows the possible parameters, and for smtp:
smtp
$params["host"] - The server to connect. Default is localhost.
$params["port"] - The port to connect. Default is 25.
$params["auth"] - Whether or not to use SMTP authentication. Default is FALSE.
$params["username"] - The username to use for SMTP authentication.
$params["password"] - The password to use for SMTP authentication.
$params["localhost"] - The value to give when sending EHLO or HELO. Default is localhost
$params["timeout"] - The SMTP connection timeout. Default is NULL (no timeout).
$params["verp"] - Whether to use VERP or not. Default is FALSE.
$params["debug"] - Whether to enable SMTP debug mode or not. Default is FALSE.
Mail internally uses Net_SMTP::setDebug .
$params["persist"] - Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.
$params["pipelining"] - Indicates whether or not the SMTP commands pipelining should be used.
If using SwiftMailer, I believe it allows you to choose between mail and smtp as well, so if you had mail being used via SwiftMailer, the same issue would occur.
Please feel free to let us know if you require any further assistance on this.
Kind regards,
Ben Stones.
Leave a comment:
-
Well PEAR is installed and I can send text emails no problembut when I try to send HTML formatted email using PEARS mime file include I get this error:
"Warning: mail() has been disabled for security reasons in D:\Parallels\Plesk\Additional\PleskPHP5\Pear\Mail\ mail.php on line 153"
The code I'm using is at the top of this here page:
Is there a conflict between PEARS mail class?
Hmmm, I'm now wondering if Swift might have been a better option lol.
Leave a comment:
-
Originally posted by Phatman View PostThanks, when PEAR's been installed I'll give it a go. (Neither are installed as standard on Windows.)
Kind regards,
Ben Stones
Leave a comment:
-
Thanks, when PEAR's been installed I'll give it a go. (Neither are installed as standard on Windows.)
Leave a comment:
-
Just like to add to this. You don't necessarily need to use the PEAR library. You can also use the SwiftMailer library as detailed in our blog post.
Kind regards,
Ben Stones.
Leave a comment:
-
Hi There,
You can use the PHP PEAR function. please refer following article referred from webkami.com :-
How to send email using pear mail when php's mail function doesn't work or gives error?
PHP mail function is disabled by eukhost and many other hosting providers for anti spam and security reasons. PHP Mail can be used to send anonymous emails, spams and is vulnerable to form injections.
You can still use a much better mailing function called PEAR:mail. Below is a sample code which you can use in any PHP file you create. Just follow the simple instructions below:
Replace the variables in the following code.
Use your email address/account created on same server.
You don't need to have the file Mail.php, it is already installed as PEAR package
<?php
require_once "Mail.php";
/**************************************************
EDIT the following variables for your own use
************************************************** */
$from = "Sender <[email protected]>";
$to = "Recipient <[email protected]>";
$subject = "Hi!"; //type in subject here
$host = "mail.exampledomain.com"; // Your domain
$username = "smtp_username"; // Your user / full email address
$password = "smtp_password"; // Password to your email address
/**************************************************
************************************************** */
$body = "";
foreach($_POST as $a => $b)
{
$body .= $a .": ". $b . "\n";
}
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
/**************************************************
ERROR MESSAGE
************************************************** */
?>
<p> <? echo $mail->getMessage(); ?> </p>
<?
/**************************************************/
} else {
/**************************************************
SUCCESS MESSAGE
************************************************** */
?>
<p>Message successfully sent!</p>
<?
/**************************************************/
}
?>
Leave a comment:
Leave a comment: