KevinTheJedi
I have added some debug logging to the code and indeed my email address is part of the "$recipients[]" array... but I don't seem to get any emails anyway... so need to check further...
New Ticket email not sent to Department members
You should check the Sent folder of the system email sending the alerts. All emails sent via SMTP should appear in the corresponding email's Sent folder.
If it’s in the sent folder then you know the issue is outside of osTicket.
Cheers.
KevinTheJedi
yes I checked that already and despite the setting is not set to "PHP mailer" but the SMTP account the "SENT" folder of the mailbox contains nothing related to osticket.
KevinTheJedi yes and I referred to this setting:
there is no email from osticket in the sent folder of this mailbox.
Alerts are sent from the System Default Email and Default Alert Email above that setting.
Cheers.
KevinTheJedi
yes and all use the same default IMAP/SMTP Mailbox:
Then if you have SMTP setup/working correctly for the helpdesk@ email you should see the sent alerts in the Sent folder of the helpdesk@ email. If not then something isn’t right.
Cheers.
KevinTheJedi I can confirm they are not there and also on my testsetup I just created locally there is nothing in the Sent items folder of the mailbox that is used for sending. (local test setup uses completely different mailserver setup)
isn't normally the "email client" is responsible for adding the mail to the sent folder? if php is directly sending using SMTP I don't see how or why the server should add this mail to the "sent" folder...
The system connects to the mail server via the hostname and port, then it logs in as the email on the mailserver using the configured authentication credentials, then it sends out the email on the mailserver. Thats simply how SMTP works.
If you go to the helpdesk@ email in the admin panel, click the Outgoing (SMTP) tab, make sure it’s enabled, and click Save Changes at the bottom does it save successfully?
Cheers.
If you don't configure SMTP then, yes, it will use PHPMailer which typically uses the local sendmail on the server. If that's the case then, no, it won't appear in the Sent folder. Emails only appear in the Sent folder if using Authenticated SMTP.
If you are not using SMTP then you need to debug on the local mailserver to see why mail isn't being sent out to you.
Cheers.
KevinTheJedi yes everything is setup as SMTP not sendmail:
and it was also on my local test install but also there was nothing in "sent"
KevinTheJedi yes and also the "Test E-Mail function works" but also the testmail is not placed in the "sent" folder in the mailbox.
- Edited
Then Idk.. every single email setup I've seen (Google, MS, YaHoo, etc.) always show the sent mail in the Sent folder when sent via SMTP. Unless your email server doesn't keep a copy in the mailbox or something which is very seldom.
At this point you'd have to just keep debugging the code as you say you are in the $recipients
array but does it skip your email? I would debug in the foreach to see if it's continuing on your email or what:
Cheers.
Kevin said "If you don't configure SMTP then, yes, it will use PHPMailer"
It will also attempt to use PHPmail if the SMTP settings fail.
If SMTP was failing then you would not see the emails in the Sent folder also.
Are you sure the the account you are using for SMTP works?
Can you test it some how (using say outlook or OWA)?
I checked all the settings and the SMTP settings are correct (if I use the wrong pw in the settings it says so) also the headers of the received mail show that is was not sent via php mail - I also changed the smtp settings to basic auth instead of "use icoming" but still - no mail sent by osticket is visible in the sent. I also tried using the account with other mail clients - they, of course, place a mail in the sent folder.
Then I am unsure what’s going on with your setup. All my instances of SMTP using Gmail, O365, YaHoo, etc. (and everyone else’s I’ve configured - over 500 at this point; maybe even over 1,000) shows sent mail in the Sent folder. Are you sure it’s sending from that email and not a different email on its behalf?
Cheers.
Question...
Is the email address that you are sending to, the same as the one that you are using to send?
If so... then that is the problem.
You have it set up to collect email from it.
Emailing itself would create a ticket.
Creating a ticket would email you.
repeat. endless loop.
osTicket will prevent that by not sending the email.
If not then I would recommend that you reach out to your email provider and see if they can look at the logs.
Maybe they are blocking the email from being sent for some reason (likely they think its spam).
They should also confirm that the system is connecting to the mailserver attempting to send the emails in the first place.
Alternatively, some mail servers still let people telnet to them.
You could google how to test a mail server with telnet and go through the step yourself.
connect to server, authenticate, give it a mail message to send, and see if you get the email your sending.