close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PEAR

Thread began 3/21/2020 6:25 am by yogastudents362523 | Last modified 3/24/2020 12:26 pm by Ray Borduin | 384 views | 21 replies |

yogastudents362523

PEAR

I have created a Contact Page.

Universal Email should be sending it out using PEAR.

I see nowhere to put any settings for a "Path to PEAR", and emails are not being sent.

Is there something I am missing in the UniEm template?

All my details seem to be correct.

Thank you,
KB

UPDATE:
Firstly:
If it helps any, this is the code it has created:

<?php
if (true) { //WA Universal Email
$Email = new WA_Email("evaluation_2");
$Email->From = "".((isset($_POST["Email_Address"]))?$_POST["Email_Address"]:"") ."";
$Email->Method = "smtp";
$Email->Host = "smtp.xxxxxxl.com";
$Email->Port = "xxx";
$Email->SMTPAuth = true;
$Email->Username = "xxxxxxxx";
$Email->Password = "xxxxxxxxxxxxxxxxxx";
$Email->addTo("xxxxxxxxxxxxxxxx");
$Email->BodyFile = "evaluation_thanks.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "evaluation from: ".((isset($_POST["Full_Name"]))?$_POST["Full_Name"]:"") ."";
$Email->send($emailGroup);
}
$Email->close();
}
?>

Secondly
I notied that it did not have includeds at the top, so I tried inserting:

<?php require_once("webassist/email/mail_php.php"); ?>
<?php require_once("webassist/email/mailformatting_php.php"); ?>
<?php require_once("webassist/email/PEAR_Mail_using_SMTP_php"); ?>

But that did not help, so I deleted them

Thanks
KB

(obviously, there is actual data where I have put xxxxxx)

Sign in to reply to this post

Ray BorduinWebAssist

You just need the one include: webassist/email/WA_Email.php

The others should be removed.

You can turn on debugging with smtp and that will give you information about when and why it is failing.

Authenticated SMTP often won't send email FROM someone other than the logged in sender.

Most likely the FROM has to be set to the same value as the $Email->Username and then you can set the ReplyTo from the form value.

Sign in to reply to this post
Did this help? Tips are appreciated...

yogastudents362523

I am afraid that has not worked, either.
I made "To" and "From" values the same, and deleted all extraneous file references. .

(Apologies for having posted code earlier. It was v early in morning, and been up all night! Sorry again)

Sign in to reply to this post

Ray BorduinWebAssist

Turn on Debug in the email settings section where you set the server. That will trace the email and provide errors.

Sign in to reply to this post
Did this help? Tips are appreciated...

yogastudents362523

I did that, but cannot find where the listing was sent
Am trying again
K

First I got a 505 error, then a blank page.
Am trying again.

Got following:

2020-03-21 17:44:20 Connection: opening to smtp.xxxxxx.com:465, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),)
2020-03-21 17:44:22 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.xxxxxx.com:465 (Connection refused) [/var/ …. …. /webassist/email/phpmailer/src/SMTP.php line 328]
2020-03-21 17:44:22 SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Now trying to decipher that gobbledygook

Thanks
KB


I am in the first instance going to assume that the port is blocked, and am therefore consulting with ISP

Sign in to reply to this post

Ray BorduinWebAssist

It could be a bad host name username or password as well. It fails when trying to connect the smtp server.

Sign in to reply to this post
Did this help? Tips are appreciated...

yogastudents362523

Hi

I am now getting a message saying:

"extension missing open ssl"

Thank you,
KB


I have run phpinfo, and openssl is definitely installed.
I have tried all combinations of tls, ssl, starttls, and ports 465 and 587
I get the least number of errors with ssl and 465 and with the following code snipper included (seemed better to put just the one line than attach a page that had my login credentials all over it; am tired and don't want to break anything by editing it out).

I read on a PHPmailer forum that it was advisable to insert the underneath line; and it did seem to reduce errors.

<?php echo (extension_loaded('openssl')?'SSL loaded':'SSL not loaded')."\n"; ?>

I will delete if you advise.

But I believe that that is what tells me that SSL is loaded OK.

Since my php and Apache also seem to have the relevant openssl enabled, I am mystified.

Thank you for your kindness,
KB

UPDATE

I am presently very tired, so it is a job to stay coherent.

I cannot recollect how it happened, but I suddely got refusals to load the Contact Form page I am creating because it was attempting to load:

www.www.xxxxxxxxxx.com

My security certificate (QuickSSL from Geotrust) is in fact for:
only for "xxxxxxxxxx.com", without that "www.".

Therefore, I tried inserting the following code snipper immediately before calling Universal Email, and to strip out that "www.":

<?php
if(!strstr($_SERVER['HTTP_HOST'],'www.'))
return;
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://'.substr($_SERVER['HTTP_HOST'],4).$_SERVER['REQUEST_URI']);
exit();
?>

This garnered a mild success in that the openssl not open error message went away …
however ...

the only thing to be seen in the browser window was the line:

SSL loaded.

Absolutely nothing else was present. At least the openssl not open error had gone.

I therefore tried introducing the following code snipper to reintroduce the "www":

<?php
$url="https://kofibusia.com:8080/href.php?redir=https://www.kofibusia.com";

I now again had a visible contact page, … BUT …

that wretched openssl not loaded error was right back up at the top of the browser window again, although the page with contact form was built.

I am now too tired to mess around with further WebAssist code, but feel that I need to find other instances where this stripping trick might work as the page is being treated.

I perhaps should also try a more efficient method of checking on the "www." code?

I found a snipper from a third party that might provide a test, but it is not wise to do anything else right now.

If you could kindly devote some fresh eyes to this, I would be grateful.

Thank you,
KB

To be clear, I sandwishced UE with code that first stripped the www., and then reintroduced it afterwards. That made the openssl not loaded error disappear, but would not load the page except for the error message at the top saying SSL loaded
Thank you

Sign in to reply to this post

yogastudents362523

Hi

I just wish to confirm:

When I use the code snippet:
<?php
if(!strstr($_SERVER['HTTP_HOST'],'www.'))
return;
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://'.substr($_SERVER['HTTP_HOST'],4).$_SERVER['REQUEST_URI']);
exit();
?>

It removes the error message that says:
"extension missing open ssl"
but leaves a single line at the top of the browser window that says:
"SSL loaded"
since the contact page will not load, I cannot test what effect that might have had on the attempt to connect through PEAR.

If I remove that code snipper the error about openssl returns.

Thank you,
KB

Sign in to reply to this post

Ray BorduinWebAssist

Delete the line you added:
<?php echo (extension_loaded('openssl')?'SSL loaded':'SSL not loaded')."\n"; ?>

That is a debug line to see if SSL is loaded and it is causing the page to not load now that ssl works it can be removed.

Sign in to reply to this post
Did this help? Tips are appreciated...

yogastudents362523

removed

The "Extension missing: openssl" returned immediately.
When I tried reusing the code snippet to removed the "www", the page would not load at all.
Blank screen
I therefore also removed those.

So back to square one with that error

Sorry
KB

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...