PHPs mail function not sending mail.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

PHPs mail function not sending mail.

Post by impulse() »

Can anyone spot a reason why the following code doesn't send an e-mail:

Code: Select all

mail("ste@stesbox.co.uk", "Quote - {$quoteFName} {$quoteCustID}",
         "From address : {$quoteAddress1}\n{$quoteAddress2}\n{$quoteAddress3}\n
                         {$quoteAddress4}\n{$quoteAddress5}\n{$quoteAddress6}\n\n
          To Address   : {$quoteDelAddress1}\n{$quoteDelAddress2}\n{$quoteDelAddress3}\n
                         {$quoteDelAddress4}\n{$quoteDelAddress5}\n{$quoteDelAddress6}\n\n
          Package Type : {$quotePackageType}\n\n
          Height       : {$quoteHeight}CM\n
          Width        : {$quoteWidth}CM\n
          Length       : {$quoteLength}CM\n\n
          Pickup Date  : {$quotePickupDay}/{$quotePickupMonth}/{$quotePickupYear}\n
          Delivery Date: {$quoteDeliveryDay}/{$quoteDeliveryMonth}/{$quoteDeliveryYear}\n\n
          Notes        : {$quoteNotes}\n");
Regards,
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If I had to guess, it would be improper settings and/or the mail server wants more headers.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Windows or Linux server? \r\n if it's windows.

However, what does mail() return?

I'd suggest passing some extra headers too... mail() won't do that for you, although it will have a pretty good job at creating a nice mess :P
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

I didn't have Sendmail started. All's working fine now :)

What headers do you suggest sending? Formatting headers?
Z3RO21
Forum Contributor
Posts: 130
Joined: Thu Aug 17, 2006 8:59 am

Post by Z3RO21 »

impulse() wrote:I didn't have Sendmail started. All's working fine now :)

What headers do you suggest sending? Formatting headers?
I love these simple errors, like when I was trying to use PHP5 in a PHP4 environment haha.
Post Reply