forgot password?


   
1 of 2
1
Emailing Invoice from Interface - Email doesn’t send
Posted: 03 November 2007 03:57 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  3
Joined  2007-11-03

When I try to email an invoice from View Invoice -> Email Invoice Button in http://mydomain.com/index.php/invoices/view/, the invoice doesn’t get emailed. How do I setup the email feature? Is it a PHP5 setting? Do I need to have a mailserver setup?

I am running Ubuntu 7.10 Server with Apache2. I have never developed with PHP5 before so i have no clue how this works.

Thanks,

Alex

Profile
 
 
Posted: 03 November 2007 04:20 PM   [ Ignore ]   [ # 1 ]  
Administrator
RankRankRankRank
Total Posts:  1274
Joined  2007-09-16

Hey Alex.

Can you send standard php mail?  Try this

$to_address 'your@email.here';
if (
mail($to'PHP test email''if you can read this, we are good')) {
echo 'mail is sent';
else {
echo 'problem sending mail';
}

change the $to_address to your own, and save the file as mailtest.php

upload it to yoru website and visit it.  What happens?

Profile
 
 
Posted: 03 November 2007 06:24 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  3
Joined  2007-11-03

I uploaded a file with the code you enclosed in the previous post. After visiting the page it just says ‘problem sending mail’. Any ideas?

-Alex

Profile
 
 
Posted: 03 November 2007 06:39 PM   [ Ignore ]   [ # 3 ]  
Administrator
RankRankRankRank
Total Posts:  1274
Joined  2007-09-16

Yup.  Contact your host and ask them if you have the ability to send mail().

Profile
 
 
Posted: 03 November 2007 06:40 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  3
Joined  2007-11-03

After a quick Google search with the phrase ‘PHP5 configure mail and sendmail’, I ran into this post http://www.linuxquestions.org/questions/linux-networking-3/mail-function-under-apachephp5-515217/
that detailed the relationship between the mail program called ‘Sendmail’ and the variable specified by ‘sendmail_path’ in the config file for PHP5. You can see what this path is specified by running ‘<? phpinfo(); ?>’

It turns out the reason why I couldn’t send mail is because I didn’t have sendmail installed on my system. On Ubuntu Server, you can remedy this by going to the command prompt type: ‘sudo apt-get install sendmail’. In order for sendmail to work, you also have to makes sure your server is able to resolve its own IP address.
Check your ‘/etc/hosts’ file to make sure your IP is specified.

After installing sendmail, I was able to run the mailtest.php script with no problems. Hope this helps anyone in the future.

-Alex

Profile
 
 
Posted: 30 November 2007 01:46 PM   [ Ignore ]   [ # 5 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

I am having problems as well: excaim
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: Bad parameters to mail() function, mail not sent.

Filename: libraries/Email.php

Line Number: 1328
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/content/d/i/t/ditollc/html/bambooinvoice/bamboo_system_files/libraries/Exceptions.php:164)

Filename: libraries/Session.php

Line Number: 295
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/content/d/i/t/ditollc/html/bambooinvoice/bamboo_system_files/libraries/Exceptions.php:164)

Filename: helpers/url_helper.php

Line Number: 455

I checked my <? phpinfo(); ?> and found this: excaim

sendmail_from
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i

I went to the Filename: libraries/Email.php file and changed 1st the $mailpath to: /usr/sbin/sendmail -t -i.

that didnt work so i took out the “-t -i”.  that didnt work either.

I then added ‘localhost’ to the $smtp_host.  no luck.

i am not very knowledgeable with php, am i even close to figuring this out? 
help!

thanks

 Signature 

Dito, LLC

Profile
 
 
Posted: 30 November 2007 04:09 PM   [ Ignore ]   [ # 6 ]  
Administrator
RankRankRankRank
Total Posts:  1274
Joined  2007-09-16

Hey dito.

Could you try this for me?  make a file called mailtest.php and put it on your server.  It should say

<?php
$to 
'your@email.com';
if (
mail($to'mail test''this is just a test')) {
     
echo 'mail sent successfully!';
else {
     
echo 'mail problem';
}
?>

Change “your@email.com” to your actual email address.  Now upload the page and visit it.  What do you have?

Profile
 
 
Posted: 30 November 2007 04:29 PM   [ Ignore ]   [ # 7 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/d/i/t/ditollc/html/mailtest.php on line 6

 Signature 

Dito, LLC

Profile
 
 
Posted: 30 November 2007 04:33 PM   [ Ignore ]   [ # 8 ]  
Administrator
RankRankRankRank
Total Posts:  1274
Joined  2007-09-16

sorry, I had a typo.  could you make that word “else” (with an “l") and try again?

Profile
 
 
Posted: 30 November 2007 04:37 PM   [ Ignore ]   [ # 9 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

mail sent successfully!

waiting to receive, about 3 min now

 Signature 

Dito, LLC

Profile
 
 
Posted: 30 November 2007 04:50 PM   [ Ignore ]   [ # 10 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

ok it came through, i will try again in bamboo and report back

 Signature 

Dito, LLC

Profile
 
 
Posted: 30 November 2007 05:07 PM   [ Ignore ]   [ # 11 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

same errors in banmboo

var $useragent = “CodeIgniter”;
var $mailpath = “/usr/sbin/sendmail”; // Sendmail path
var $protocol = “mail”; // mail/sendmail/smtp
var $smtp_host = “localhost”; // SMTP Server.  Example: mail.earthlink.net
var $smtp_user = “”; // SMTP Username
var $smtp_pass = “”; // SMTP Password
var $smtp_port = “25”; // SMTP Port
var $smtp_timeout = 5; // SMTP Timeout in seconds
var $wordwrap = TRUE; // true/false Turns word-wrap on/off
var $wrapchars = “76”; // Number of characters to wrap at.
var $mailtype = “text”; // text/html Defines email formatting
var $charset = “utf-8”; // Default char set: iso-8859-1 or us-ascii
var $multipart = “mixed”; // “mixed” (in the body) or “related” (separate)
var $alt_message = ‘’; // Alternative message for HTML emails
var $validate = FALSE; // true/false.  Enables email validation
var $priority = “3”; // Default priority (1 - 5)
var $newline = “\n”; // Default newline. “\r\n” or “\n” (Use “\r\n” to comply with RFC 822)

var $crlf = “\n”; // The RFC 2045 compliant CRLF for quoted-printable is “\r\n”.  Apparently some servers,
// even on the receiving end think they need to muck with CRLFs, so using “\n”, while
// distasteful, is the only thing that seems to work for all environments.

 Signature 

Dito, LLC

Profile
 
 
Posted: 30 November 2007 06:02 PM   [ Ignore ]   [ # 12 ]  
Administrator
RankRankRankRank
Total Posts:  1274
Joined  2007-09-16

I went to the Filename: libraries/Email.php file and changed 1st the $mailpath to: /usr/sbin/sendmail -t -i.

Hm, ok, there are a few different ways to send mail in Bamboo, and it should be defaulting to mail and not sendmail, which your error seems to indicate it is, which means that since the test script worked, so should this one.  So I’m confused.  Let me think about this one for a bit and get back to it.  A new bamboo is being released next week (I hope) and it may solve your issues.

Profile
 
 
Posted: 30 November 2007 06:57 PM   [ Ignore ]   [ # 13 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

ok.  i had messed with the email.php file when i encountered this error originally, i just replaced it with the default, to the same results.  i can still export to pdf and email the invoice and its still there for my records, so all is not lost.

 Signature 

Dito, LLC

Profile
 
 
Posted: 06 December 2007 06:06 PM   [ Ignore ]   [ # 14 ]  
Newbie
Rank
Total Posts:  6
Joined  2007-12-06

Hello everyone,

I’m a newbie user - just got it installed (& skinned) and MAN I have to say that I am IN LOVE with this app. My hat is certainly off to you Derek for sharing with the rest of us. Bravo.

My only issue is the email function. I have read through this thread and attempted every fix, to no avail. Maybe someone has a suggestion for my situation?

When I use the email function, all indications from the script say that the message was sent.

sendmail is working fine on this domain, as indicated by the ‘mailtest.php’ as referenced in this thread (got the message from that) ss well as from the other scripts I run on this site sending mail internally.

The only difference I can tell is that I am running Google Apps for your Domain to handle the mail functions for this domain, but it has never interfered with the server’s sendmail capabilites, so I doubt that’s the problem. )It would however make it more complicated to use SMTP with this setup.) Any ideas why the system SAYS the mail was sent - but nothing in the inbox?

Thanks for any help or suggestions from a newbie. THIS THING ROCKS!!!

- 7forward

Profile
 
 
Posted: 06 December 2007 06:10 PM   [ Ignore ]   [ # 15 ]  
Newbie
Rank
Total Posts:  17
Joined  2007-11-29

i’m using google hosted email as well, fyi.  i have other php apps installed on the same server that handle mail just fine and in a similar (if not identical) manor.

 Signature 

Dito, LLC

Profile
 
 
   
1 of 2
1