PDA

View Full Version : no emails being sent


dreamworx
02-23-2009, 07:37 AM
hello all

This is the first time i have used this, the install and SQL went well, and the call logging works perfectly! its pretty amazing. only thing i cant get working is the email sides of things. Im using bluehost to supply my webserver, but i cant figure out howto send mail? help would be much appeciated please

Thank you

dreamworx
02-23-2009, 10:19 AM
hello all

This is the first time i have used this, the install and SQL went well, and the call logging works perfectly! its pretty amazing. only thing i cant get working is the email sides of things. Im using bluehost to supply my webserver, but i cant figure out howto send mail? help would be much appeciated please

Thank you

Can anyone help with this? should the software just send emails as soon as its installed using mail.php or is this not the case?

dreamworx
02-23-2009, 10:42 AM
ive also created a php_mail file and this sends mail from my server fine, im not sure what is going on?

dreamworx
02-23-2009, 12:34 PM
just for info, i have tried a reinstall to a different directory and it is still the same. Can anyone help with this?

jpowers40828
02-23-2009, 12:49 PM
Have you set it to send alerts in the admin panel?

dreamworx
02-23-2009, 01:20 PM
Have you set it to send alerts in the admin panel?

yep, i got it to send everything.

jpowers40828
02-23-2009, 01:31 PM
in class.ticket.php ~ line 1009 find

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

replace it with
mail($cfg->getAdminEmail(),$subj,$alert,"From: ".$cfg->getAlertEmail());

see if that works, if it does we know its a problem with the sendmail function.

ps. you have checked your spam folder correct?

dreamworx
02-23-2009, 01:52 PM
in class.ticket.php ~ line 1009 find

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

replace it with
mail($cfg->getAdminEmail(),$subj,$alert,"From: ".$cfg->getAlertEmail());

see if that works, if it does we know its a problem with the sendmail function.

ps. you have checked your spam folder correct?

Hi mate

I dont have a spam filter as im hosting my own emails on the server that i am using. i have a number of domains that i run and couldnt recieve or send any emails.

I have changed the above but it didnt do anything, should "mail" be Mail? would that make a difference?

jpowers40828
02-23-2009, 02:16 PM
no mail is proper, but it shouldn't make a difference. Did you create a new ticket in order to test it?

dreamworx
02-23-2009, 03:43 PM
yeh i created the new ticket but still nothing.

The zip file that comes with osticket has a folder called scripts, does need to be added? i couldnt see anything about those and where to put the 2 files?

jpowers40828
02-23-2009, 04:01 PM
I believe those are for email piping, which allows clients to send you emails and for it to create a new ticket.

And you're sure the php_mail.php file you uploaded went to the same server, and that worked?

dreamworx
02-23-2009, 04:09 PM
I believe those are for email piping, which allows clients to send you emails and for it to create a new ticket.

And you're sure the php_mail.php file you uploaded went to the same server, and that worked?

hi mate 150% worked fine, i only have the one server. PM me your email and i will send you a mail from my php_mail file?

if it helps im using PHP version 5.2.8

dreamworx
02-24-2009, 05:16 AM
I have since changed this
In class.tickets.php ~ line 995 is the call to the mail function. Try replacing

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

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

and now im getting sent the emails! but the person who logs the call iwsnt getting any emails. I have tried lots of email addys but nothing is recieved. At least im getting warned about the call i guess but could really do the person who logged the call to get an email. anyhone else had this?

jpowers40828
03-01-2009, 03:15 AM
~line 354


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

to

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


~line 380

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

to

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


~line 430

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

to

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


~line 512

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

to

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


~line 549

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

to

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


~line 649

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

to

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


~line 973

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

to

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


~ line 995

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

to

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


~ line 1017

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

to

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

Changing this worked for him.

dreamworx
03-02-2009, 07:30 AM
This worked for me very well!!

cch
03-04-2009, 01:44 AM
can u specify the function on which line we should modify for the changes?
i've try to change the php but it cross my page become blank.
so maybe i copy to the wrong line.
pls help because i need it urgent.
thanks

actually if sender and receiver is using gmail. it ok and the mail is sent.
but if sender and receiver is using others email like 'company mail'. it cant sent and received at all.

what is the problem actually?
is it coding error?
or configuration error?
or what else?

plus may i know whether this product have any training material?
like training material to configure scp or any else.

//Ok...we are ready to go...baby!
foreach( $recipients as $k=>$staff){
if(!$staff || !is_object($staff) || !$staff->isAvailable()) continue;
if(in_array($staff->getEmail(),$sentlist)) continue; //avoid duplicate emails.
$alert = str_replace("%staff",$staff->getFirstName(),$body);

Misc::sendmail($staff->getEmail(),$subj,$alert,$cfg->getAlertEmail()); //ori
//mail($staff->getEmail(),$subj,$alert,"From: Support <".$cfg->getAlertEmail().".>\r //new add on
$sentlist[]=$staff->getEmail();
}

just found out the last of the modify will cause the page become blank (line of 'new add on'). do the syntax is correct?

without the changes of the syntax. the effect between my previous version and modify version is only the 'premake Reply Email Address' was change.

i was test it by given the gmail to open ticket. so my gmail is received the mail. but still is the same, which if i given the 'company mail', the mail will not received.

can anyone give suggestion?

jpowers40828
03-04-2009, 12:16 PM
In response to CCH

I've changed the post with all the changes on it, you should go back and make sure they are all like i've stated, as I changed some very minor but important details on them. I've also updated the line numbers.

masino_sinaga
04-18-2009, 04:24 AM
actually if sender and receiver is using gmail. it ok and the mail is sent.
but if sender and receiver is using others email like 'company mail'. it cant sent and received at all.

what is the problem actually?
is it coding error?
or configuration error?
or what else?

In my humble opinion, if sender/receiver using gmail okay, then the other email should be okay, too. I suggest you to contact your mail-server admin to make sure your company mail can send and receive email from outside of your company domain. Let us know the result. Thanks.

Best regards,
Masino Sinaga

jpowers40828
04-18-2009, 11:00 AM
One of the main problems is that some email servers automatically reject emails with improper headers. So if some are going through and some aren't, it usually has to do with that. osTicket is known to have problems with the sendmail function within it.