The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sending e-mail
#1
Hello,

Ive been working with UserSpice the past few days. It's an excellent project, my compliments!
Everything seems to be working...except sending e-mail Sad

At the website of SwiftMailer they say the following:

The Swift_SmtpTransport and Swift_SendmailTransport transports use proc_* PHP functions, which might not be available on your PHP installation. You can easily check if that's the case by running the following PHP script: <?php echo function_exists('proc_open') ? "Yep, that will work" : "Sorry, that won't work";

I have run that script and it tells me that it wont work for me.

Now, ive seen that you implented the PHPMailer as well. I just have NO idea how to make use of it in UserSpice. I cannot find any documentation about it or any topics in this forum.

I have seen you mentioning the following on January 29th in this forum:
I’ve actually come up with a decent solution. I’m storing all the swiftmail configuration variables in the database so they can be edited by the end user. There will be a dropdown to choose which type of mail product you want to use and it will just map in the proper settings. I’m going to start with direct server mail, mailgun, and mandril and go from there.

But I don't see anything about this in UserSpice 4.0 or 4.1.

Can you please explain how to use a different mail transport so I can send smtp mails from my server.

Thank you so much for all your hard work!
With kind regards,
Lloyd
  Reply
#2
I fixed it! Woohooo! Smile

My mail server uses an SSL encryption. In "users/helpers/helpers.php" I changed
Code:
$mail->SMTPSecure = 'TLS';
into
Code:
$mail->SMTPSecure = 'ssl';
(lower case is important here). And now it all seems to work fine.

The only thing I'm stuck on now is that the link sent to my email is not working when I click on it on my Android phone, and the link is not clickable (it's only displayed as a full url) on my pc.

Would there be a way to fix that?
  Reply
#3
Right...this is getting silly. Everytime I post here, I seem to be able to fix it myself a little while later! Tongue

Anyway, you seem to be missing the http:// in front of the link in "users/views/_email_template_verify.php" and in "users/views/_email_forgot_password.php"
  Reply
#4
I'm sorry that that part has not been well documented yet. One of the biggest reasons that UserSpice 4.1 is so much smaller than 4.0 is that we got rid of composer and swiftmailer and went to regular phpmailer. Due to legacy defaults in the mail settings it still looks like we're using swiftmailer.

Thanks for your feedback and we'll make that better. I'll check on the missing views issues as well.
  Reply
#5
I will look into those links to see. Also, the transport is something that was fixed, and we have a "list" of settings that need to be set for different providers. Who are you using as your provider? I would be surprised if they only supported SSL, since TLS supercedes it and SSL is pretty old. It may be they are running TLS on some other port perhaps.

I any case, I will take a look at the links, I just need to update my own setup. Regarding the "missing links" there, I believe what you are pointing to are the email templates, but I may be mis-interpretting what you are pointing out.

Can you be a bit more verbose on where (in what files) you are referring to the missing http://? One issue with specifying the http protocol, is that some sites, like my development site, use TLS on the webserver itself, so it would need to be httpS://. I figured most applications would parse the url correctly without it, but perhaps not as you are finding out.

Any more clues on exactly how you arrive at each issue helps us work out the actual problem and get the right solution. Thanks!

-B
  Reply
#6
Hello Brian (and mudmin of course), thank you for your reply.

My provider is based here in The Netherlands. Whenever I create a new mailaddress the info provided to me says SSL on Port 465. They never speak about TLS. I suppose I could ask them about it Smile

In regards to the missing http://
I mistyped one of the paths, but they can be found in:

users/views/_email_template_verify.php” and in “users/views/_email_template_forgot_password.php

Code:
<p><a href="<?=$results->verify_url?>?email=<?=$email;?>&vericode=<?=$vericode;?>">Verify Your Email</a></p>

and

Code:
<p><a href="<?=$_SERVER['HTTP_HOST'].$us_url_root?>users/forgot_password_reset.php?email=<?=$email;?>&vericode=<?=$vericode;?>&reset=1">Reset Password</a></p>

Which should be:

Code:
<p><a href="http://<?=$results->verify_url?>?email=<?=$email;?>&vericode=<?=$vericode;?>">Verify Your Email</a></p>

and

Code:
<p><a href="http://<?=$_SERVER['HTTP_HOST'].$us_url_root?>users/forgot_password_reset.php?email=<?=$email;?>&vericode=<?=$vericode;?>&reset=1">Reset Password</a></p>

Maybe there should be a choice to either use SSL or TLS in the email settings?
  Reply
#7
You can simply try TLS over that port. It will tell you if it worked or not (though, the error messaging isn't particularly good yet).

I will think more about the missing http:// and whether we will run into any problems (for example, if the website is using TLS...it is possible most servers will be setup to redirect http to https.). I'll probably be able to look at it more tonight (i.e. 10 hours from the time of this post, or so) if I don't think of anything in the meantime.
  Reply
#8
So what you have done is fixed it in your code, which is good. We need to add a few more descriptors so that the settings are a little more clear. We do have a place where we have collected some examples of working settings...we will need to make it available somehow to the community so it becomes clear what types of values are expected.

EDIT: I have made the changes to the code for the issues you experienced. I can either send you the files I updated, or you can wait until we release an actual patch to the community at large.
  Reply
#9
By the way, send this to your provider. If they are still/only supporting SSL, it shows a weakness in their knowledge of modern security "best practices":

https://en.wikipedia.org/wiki/Transport_...ty#SSL_3.0

Requesting support for TLS for mail security is reasonable.
  Reply
#10
Thanks Brian. I just sent them an email asking about this. Let's see what they say Smile

It's all working for me now, so I will wait for a patch. I have different issues I'm working on now...mainly trying to create a search function to search the users in the database. So far...no luck. I just cant seem to get it right Sad
Will ask about this in a new topic.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)