Hello,
I am fairly advanced with everything in general including making code edits and understanding code, however with php I'm still a little bit of an amateur. Here is my problem:
I have osTicket 1.6 installed on my web host (streamline.net) for my website. I've set it to use PHP mail for outgoing emails. This is where I'm having the problem.
If someone posts a ticket, then they receive the notification that they've posted a ticket (as per my settings) however I don't receive anything to my email address (which is an address to a mailbox with my web host - the same host that hosts my site).
If I post a test ticket myself and use an email address, for example my gmail account, I'll receive the email notification. But when I check my host's email (admin@anypcfixed.co.uk) for a notification that i've received a new ticket, I've not received it. Even if i post a test ticket using one of my host's email boxes (anything@anypcfixed.co.uk), i receive nothing.
To cut it short, my web host's php mail function is refusing to send any emails to it's own email accounts, however will send with no problems to any other host (and i've done test tickets to gmail accounts, yahoo, virginmedia, all receive notifications properly via the php mail scripting but i just don't receive any email notifications to any of my admin or enquiries email accounts under my host).
I've spoke to my web host and they sent me back the following reply which may make more sense to you fellow php experts out there. My question is, what is my course of action i.e. which php files do I edit to try and get this script to send successfully to my web hosted email accounts?
Response from web host:
Hi Nimesh Patel,
Thank you for your query
To prevent spam being sent through our webservers, there are certain conditions
that must be met before our SMTP servers will send the email.
Email must be sent to, or from, an existing email address hosted by Streamline.
This must be a mailbox on the same domain name on which the form to mail script
is being hosted.
To stop misuse of your form by third parties the sendmail_from variable should
be set to your Streamline hosted email address. While access to the php.ini
file is restricted on our shared environment, you can send this variable using
the ini_set() command, shown below. A fifth parameter, -f, should be added to
the sendmail function. This will set the name of the from email address.
In its basic form, a simple sendmail script will look like this:
<?php
ini_set("sendmail_from", "user@yourdomain.com");
mail($email_to, $email_subject, $email_message, $headers, "-fuser@yourdomain.com");
?>
Provided that your form to mail script meets the requirements above, you should
have no problems. Third party scripts using sendmail will also work on
Streamline servers, although some will need slight changes made in order to
work correctly.
Kind regards
The Streamline.net team - Web hosting made easy
Many thanks for your help!