The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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
smtp Mail
#1
I just did a fresh/new install 4.1.2 and am trying to get the email settings to work. I have setup and verified a mailgun account so send SMTP mail through. How would I go about trouble shooting this?
  Reply
#2
@Brian I know you've done some troubleshooting work.
  Reply
#3
What settings are you using? At the moment? Obviously mask anything you wouldn't want anyone else to see. Maybe I can try setting up an account and see if it works.
  Reply
#4
So I just setup a mailgun account, and was able to make it work with userspice just fine. That being said, what email are you using to test sending to? If you are sending to a Gmail account (as I tried to do at first) it may be delayed in delivery due to it being a new setup (mine eventually came through, but took about 10 minutes). If you have an alternate email address to test with, besides gmail, that might help. These are what I used:

SMTP Sever: smtp.mailgun.org
SMTP Port: 587
Email Login/Username: *from mailgun domain dashboard*
Password: *from mailgun domain dashboard*
Transport: TLS (encrypted)

Port 465, and port 25 did NOT work. Port 2525 (as per here: http://blog.mailgun.com/25-465-587-what-...uld-i-use/) DID work as well.

As long as your domain is verified and DNS setup correctly, then it should work fine. I haven't made any changes to my code for this to work.
  Reply
#5
For the life of me I could not get the SMTP from either my host (bluehost.com) or to MailGun's SMTP working. So I ended up modifying the users/helpers/helper.php email function to use phpCurl into MailGun. It took another DBTable (as I did not want to force changes on the email table) but all seems to be working now. I'm sure more testing is needed.

function email($to,$subject,$body){
$db = DB::getInstance();
$query = $db->query("SELECT * FROM MYmailgun");
$results = $query->first();
$config = array();
$config['api_key'] = $results->apikey;
$config['api_url'] = $results->apiurl;
$message = array();
$message['from'] = $results->from_email;
$message['to'] = $to;
$message['h:Reply-To'] = $results->from_email;
$message['subject'] = $subject;
$message['html'] = $body;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $config['api_url']);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "api:{$config['api_key']}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$message);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
  Reply
#6
Can you give me the settings that you used for Bluehost or MailGun? I'm sure we can get it working, and TLS should generally work out of the box...
  Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)