PDA

View Full Version : Email Problems.


etalkishere
03-02-2009, 03:23 PM
Hi,

I had the same issue. I have my site hosted under bluehost. osTicket does'nt send any email, whenever a new ticket is opened. I checked everywhere and confirmed the settings correctly set. I also verified sendmail setup correctly under my bluehost account (i was able to send an email, using a mail application on bluehost).

I tried to locate class.tickets.php, but can't find. Where folder of osTicket is it exactly under?

Thanks in advance.

Peter

jpowers40828
03-02-2009, 03:30 PM
include

Must not have looked too hard.

etalkishere
03-03-2009, 10:04 AM
First, I can't find the class.tickets.php under include folder. Only class.ticket.php file.

Second, I can't match up the same line numbers referenced here by jpowers and line numbers in the class.ticket.php.

Help please!

~line 366


Misc::sendmail($cfg->getAdminEmail(),$subj,$alert,$cfg->getAlertEmail());

to


mail($cfg->getAdminEmail(),$subj,$alert,"From: Support <".$cfg->getAlertEmail().".>\r\n");

~line 392


Misc::sendmail($staff->getEmail(),$subj,$alert,$cfg->getAlertEmail());

to

mail($staff->getEmail(),$subj,$alert,"From: Support <".$cfg->getAlertEmail().".>\r\n");

~line 442

Misc::sendmail($staff->getEmail(),$subj,$body,$cfg->getAlertEmail());

to

mail($staff->getEmail(),$subj,$body,"From: Support <".$cfg->getAlertEmail().".>\r\n");

~line 524

Misc::sendmail($this->getEMail(),$subj,$body,$from,$fromName);

to

mail($this->getEmail(),$subj,$body,"From: ".$fromName." <".$from.".>\r\n");

~line 561

Misc::sendmail($staff->getEmail(),$subj,$alert,$cfg->getAlertEmail());

to

mail($staff->getEmail(),$subj,$alert,"From: Support <".$cfg->getAlertEmail().".>\r\n");

~line 663

Misc::sendmail($this->getEmail(),$subj,$body,$from,$fromName,$headers);

to

$headers .= "From: ".$fromName." <".$from.">\r\n";
mail($this->getEmail(),$subj,$body,$headers);

~line 987

Misc::sendmail($ticket->getEmail(),$subj,$body,$from,$fromName);

to

mail($ticket->getEmail(),$subj,$body,"From: ".$fromName." <".$from.".>\r\n");

~ line 1031

Misc::sendmail($staff->getEmail(),$subj,$alert,$cfg->getAlertEmail());

to

mail($staff->getEmail(),$subj,$alert,"From: Support <".$cfg->getAlertEmail().".>\r

Changing this worked for him.

jpowers40828
03-03-2009, 12:49 PM
I'm sorry, you are correct, it is class.ticket.php. The line numbers are rough estimates, as I have done mods and such, you should be able to do a find though.

etalkishere
03-04-2009, 04:49 AM
I got it to work, after modifying the code per your suggestions. Thanks for your help jpowers40828!

I still have an issue. The FROM field of the received email (generated when a new ticket was submitted) shows: "username@box500.bluehost.com", where username=my user name for my bluehost.com account, as opposed to "Support@mysite.com", where mysite.com is my domain name hosted under bluehost.com. Note, mysite.com is a 'add on' domain on bluehost.

I tried different things like, setting "Auto response FROM Email:" to "Dept Email (above)" under Admin Panel's Departments. "The Dept Email:" is set to "Support@mysite.com".

Here are the settings under "Email Settings", under Admin Panel:
Default Email: Support@mysite.com
No Reply Email Address: noreply@mysite.com
Alert(s) FROM Email Address: alerts@mysite.com
System Admin Email Address: admin@mysite.com

Please help!

I'm sorry, you are correct, it is class.ticket.php. The line numbers are rough estimates, as I have done mods and such, you should be able to do a find though.

jpowers40828
03-04-2009, 12:39 PM
etalkishere,

Which email when a ticket is submitted, the one the client receives or the alert to staff?

etalkishere
03-04-2009, 12:50 PM
It's the email the client receives, which has the ticket # information.

Thanks.

jpowers40828
03-04-2009, 12:54 PM
It's the email the client receives, which has the ticket # information.

Thanks.

So its going to be the one on line 973.

So right above it there is

}else{
$from=$cfg->getNoReplyEmail();

Add this line after that.

$fromName = "Support"; //or whatever you want in there for a name

etalkishere
03-04-2009, 10:22 PM
This should work, but this is hard coded. I don't think it is a good idea.

Shouldn't it get From information from the Update Department tab, like the Department Email field?

Thanks.

So its going to be the one on line 973.

So right above it there is

}else{
$from=$cfg->getNoReplyEmail();

Add this line after that.

$fromName = "Support"; //or whatever you want in there for a name

jpowers40828
03-05-2009, 01:51 AM
It is hard coding the name in, but only when there isn't department information. It should be pulling it from the department, try it and if it makes a difference we know its not pulling from the department and we can go from there.

etalkishere
03-05-2009, 03:11 AM
Sorry, after adding in that line, it could not generate emails like before. I removed it, and now it works, but still show username@bluehost.com as opposed to support@mysite.com.

Any other suggestions?

Thanks in advance!

jpowers40828
03-05-2009, 10:20 AM
In your admin panel, look under the departments. I'm not sure how many departments you have setup, but look through each one. The last option when you click on a department, is the auto response FROM email set to "No Reply Email" or "Dept Email (above)"

etalkishere
03-05-2009, 03:45 PM
In mail #5 in this email chain, I indicated that...

I set "Auto response FROM Email:" to "Dept Email (above)" under Admin Panel's Departments. "The Dept Email:" is set to "Support@mysite.com".

jpowers40828
03-05-2009, 04:07 PM
What do you have in the optional name field in emails?

etalkishere
03-06-2009, 02:22 AM
In Emails, I have:

Email Address: set to 'support@mysite.com'
Email Name: set to 'Support'
New Ticket Priority: set to 'Normal'
New Ticket Dept: set to 'Support Dept'
Auto Response: 'Disable autoresponse for this email' not checked.

jpowers40828
03-06-2009, 02:42 AM
Ok, we re not really getting anywhere, so lets simplify it.

First, the initial post you read by me, i've updated, you should make sure you update all the lines.
http://osticket.com/forums/showthread.php?t=1829

Line 973

Let's start with the simple. If this works ok, lets move on.
mail($ticket->getEmail(),$subj,$body,"From: support@mysite.com\r\n");

mail($ticket->getEmail(),$subj,$body,"From: ".$from."\r\n");
Let me know if you can get past those two steps.

etalkishere
03-09-2009, 12:28 AM
Yes!!! It works!!!

On line 973...
1) this one, part of original code, didn't work:
mail($ticket->getEmail(),$subj,$body,"From: ".$fromName." <".$from.".>\r\n");

2) this one works, as a test, with hard-coded "support@mysite.com":
mail($ticket->getEmail(),$subj,$body,"From: support@mysite.com\r\n");

3) this one works!!! Thus, line 973 is now replaced with this line below:
mail($ticket->getEmail(),$subj,$body,"From: ".$from."\r\n");

Thanks very much jpowers40828 for great help!!!

Ok, we re not really getting anywhere, so lets simplify it.

First, the initial post you read by me, i've updated, you should make sure you update all the lines.
http://osticket.com/forums/showthread.php?t=1829

Line 973

Let's start with the simple. If this works ok, lets move on.
mail($ticket->getEmail(),$subj,$body,"From: support@mysite.com\r\n");

mail($ticket->getEmail(),$subj,$body,"From: ".$from."\r\n");
Let me know if you can get past those two steps.

jordanroth
03-09-2009, 05:40 PM
I'm having the same email issue however,

If a user from the same domain sends an email to the same doman - all emails get through.

IF a user not from the same domain as the helpdesk - the email get lost.

jpowers40828
03-09-2009, 05:47 PM
Try doing this.

http://osticket.com/forums/showpost.php?p=6576&postcount=14