XF 1.2 SMTP Mail Server Not Working Properly

RG70Hz

Active member
I have a domain & domain email all set up. I have some questions I need help with for trouble shooting.

Background info:
OS: Windows Server 2019
Web Server: IIS 10 (using php8)
Forum software: XenForo [1.2.9] (using php5.6.9)
Database: MySQL

I have a locally hosted website using my domain [my domain name]. It uses XenForo forum software and is routed through cloud flare. I have my email routing set up through iCloud [and configured in cloud flare]. Everything is set up, and working, so far.

My goal is to use SMTP to allow for my domain to send emails. Auto generated emails. For example, when a user signs up for my site, they are "Awaiting User Verification". They are supposed to receive and email from my domain (noreply@[mydomainname]) so they can "verify" and be redirected back to the site and become a fully registered user (allowing for total account access ex: change profile picture, post, etc.).
[Note: I temporarily disabled firewall for testing just in case]
I have my SMTP configured like this:

IIS 6.0 Manager >
General tab:
Ip address: (set to my static internal ip of [internal ip])
Access Tab:
Relay restrictions > "All except the list below"
Authentication > Anonymous Access
Delivery Tab:
Outbound Security > Anonymous Access, Enabled TLS Encryption
Outbound Connections > Port 587 (already forwarded on my router [internalip]:587 and in my firewall settings)
Advanced > Default settings

I used the service "https://www.emailsettings.email" to obtain my information for my iCloud email (primary email associated with my domain email) and got this information:
INCOMING SERVER IMAP POP3
Username: [myicloudemail] ...
Server Hostname: imap.mail.me.com ...
Server Port: 993 ...
SSL/TLS: SSL ...
Authentication: App Specific Password ...
OUTGOING SERVER SMTP
Username: [myicloudemail]
Server Hostname: smtp.mail.me.com
Server Port: 587
SSL/TLS: TLS
I input this same information into my XenForo admin panel in "Home > Options > Email Options". I used the "OUTGOING SERVER SMTP" configuration listed above and enabled TLS.

Telnet:
My telnet is also working. In CMD I type "telnet [internal ip] 587" and get the following response: "220 [server name] Microsoft ESMTP MAIL Service, Version: 10.0.17763.1697 ready at Fri, 24 Feb 2023 23:19:04 -0330" which tells me its also working. However, when I sign in and create an email, everything is fine until I try to send the email.

I have a few emails QUEUED but have no idea how to send them.

Also, for what it's worth, I have tried the "sendmail -q" [within cmd & telnet] command per ChatGPT but no luck. It returns a "Batch command not found"

These are the commands I used for telnet:
telnet [internal ip] 587
HELO [mydomainname]
MAIL FROM: [my iCloud email]
RCPT: [test email]
DATA
Subject: Test Email
This is a test email.
.
QUIT

When I use the QUIT command, it just closes the connection [says lost connection to host]. The options listed in telnet are:
"HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH TURN ETRN BDAT VRFY".

It does not give me parameter options.

I do not know where to look for any logs for telnet. I also don't see anything in "events". Maybe I don't know what to look for.
Now onto my php settings. In both php.ini files (php5 & php8) I have the following configuration for SMTP:
[mail function]
SMTP = [internal ip]
; https://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; https://php.net/sendmail-from
sendmail_from = [my iCloud email]

Inside "SMTP Emails" [in IIS Manager] I have the iCloud email configured.

All services are running [when I checked Services].

I sent an email from my domain email [hosted on iCloud] and it sent [through the mail app]

I think this is all the information needed to help troubleshoot. If more is needed, I will provide.

Onto my questions:
  1. Why are my emails not sending?
  2. How do I send the emails in the QUEUE (Any other option besides "QUIT"?)?
  3. Do I have any options besides the "LIST" option since it's not listed in my telnet?
  4. Is there any other way to test this?
It's important to note that I am novice but have the burning desire to learn, so any info provided must be clear and concise.
 
Last edited:
The only "add" you need to do is have a valid sending account set up with SendGrid with a username, a password, the correct port, the correct encryption and the recipient SMTP server you are sending to. In the default XF setup, you cannot use any SendGrid API's, as there is no configuration for that. IPS DOES have that ability, but XF is simply PHP mail or SMTP for sending. There are no integrated API's with any of the major transactional email providers.
It's not "strange". It's simply that you are not familiar with what you need to do to send email from your XF instance.

In a nutshell
You need to have an SMTP server that you can send to
You need to have a valid account on that SMTP server to log in with
You MUST have the SMTP server address, the port # to use AND what security (SSL/TLS) that they are using
You MUST not block those outbound ports on your server
You MUST set up the the username, password, port, SMTP server and the security (SSL/TLS) in the XF ACP to send email.

And we haven't even touched on DKIM, SPF, DMARC or such.
 
The only "add" you need to do is have a valid sending account set up with SendGrid with a username, a password, the correct port, the correct encryption and the recipient SMTP server you are sending to. In the default XF setup, you cannot use any SendGrid API's, as there is no configuration for that. IPS DOES have that ability, but XF is simply PHP mail or SMTP for sending. There are no integrated API's with any of the major transactional email providers.
It's not "strange". It's simply that you are not familiar with what you need to do to send email from your XF instance.

In a nutshell
You need to have an SMTP server that you can send to
You need to have a valid account on that SMTP server to log in with
You MUST have the SMTP server address, the port # to use AND what security (SSL/TLS) that they are using
You MUST not block those outbound ports on your server
You MUST set up the the username, password, port, SMTP server and the security (SSL/TLS) in the XF ACP to send email.

And we haven't even touched on DKIM, SPF, DMARC or such.
I was referring to their test email option. It’s strange that their email testing isn’t working and I’m assuming it’s because my account is under review. The port is already open like I said. I only modified the php to comment out what I originally had in for my SMTP. I only want to use SMTP so I don’t care about their API. This is just for user verification email for xenforo.

I have all of that configured. Send grid credentials are integrated into my admin cp. the DNS records are created. Port is open. Firewall is disabled temporarily for testing.

If I am missing something let me know. SMTP on iis is disabled like I mentioned.
 
If I am missing something let me know. SMTP on iis is disabled like I mentioned.
If your account is still under review, you are probably limited on where/to who you can send. Amazon SES is like this, they have authorized accounts and those are the ONLY ones you can send to until you are out of the sandbox.
I don't use SendGrid, so I have no idea on what their policy is... so I would recommend simple patience until your account is fully activated.
Personally.. I prefer Amazon SES... it's rather a hassle to set up, but it's MUCH cheaper for transactional email.
It's really not that difficult to set up.. heck, I've got MailerSend set up on a test SMF site in about 5 minutes.
 
Last edited:
If your account is still under review, you are probably limited on where/to who you can send. Amazon SES is like this, they have authorized accounts and those are the ONLY ones you can send to until you are out of the sandbox.
I don't use SendGrid, so I have no idea on what their policy is... so I would recommend simple patience until your account is fully activated.
Yes. I understand. How do you find Amazon? Is it free? I’m trying to do all of this with no cost. Amazon is obviously huge and has great customer support. Not to mention, next fall I will have a course dedicated to Amazon web hosting. This would be great experience.
 
Yes. I understand. How do you find Amazon? Is it free? I’m trying to do all of this with no cost. Amazon is obviously huge and has great customer support. Not to mention, next fall I will have a course dedicated to Amazon web hosting. This would be great experience.
For the amounts I currently send, it's free (because I send so few) but even if I was sending around 50K a month, it would only be about $5-$7 USD.
 
For the amounts I currently send, it's free (because I send so few) but even if I was sending around 50K a month, it would only be about $5-$7 USD.
Update. everything is working fine and includes DKIM, SPF. I don't think DMARC is implemented yet. So happy.
 
Top Bottom