Ezilon.com - Target Your Audience, be Seen in Your Region

Recover PHP mail

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
teammatt3's picture
Moderator

He has: 1,854 posts

Joined: Sep 2003

Is there a way to view/recover the emails you sent with mail()? Would they be in a server log somewhere?

Greg K's picture
Moderator

He has: 1,628 posts

Joined: Nov 2003

Don't know if you can or not but a way around this in the future is to BCC: an e-mail address specifically set up for receiving them, which is how I do it. (ie. all sign up receipts and renewal receipts BCC a copy to me that I archive off.

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com

JeevesBond's picture
Moderator

He has: 3,516 posts

Joined: Jun 2002

That's a good way of doing it Greg. PHP's mail() function just uses whatever smtp server is installed on the machine. That's usally sendmail isn't it? I'm 99% certain sent messages aren't saved unless you've specified it somehow, e.g. in the additional_parameters.

You might be able to find a way of saving sent messages, check you're using sendmail, then have a look at the documentation on: http://www.sendmail.org/ or--probably easier--just use Greg's method. Smiling

a Padded Cell our articles site!

teammatt3's picture
Moderator

He has: 1,854 posts

Joined: Sep 2003

Definitely going to use Greg's method from now on. The problem is, I wasn't before and I found out that the emails weren't being sent for a few days. I need to figure out which ones need to be re-sent. Looks kind of hopeless now. I'll have to check out the sendmail docs though. Oh boy Sticking out tongue

JeevesBond's picture
Moderator

He has: 3,516 posts

Joined: Jun 2002

matt wrote: I need to figure out which ones need to be re-sent.

Ack, well often the only way we learn stuff is by making the odd mistake or two. Smiling

Good luck working out which ones need to be re-sent, and if you need a hand you know where we are!

a Padded Cell our articles site!

Greg K's picture
Moderator

He has: 1,628 posts

Joined: Nov 2003

Re-mail everyone for the the past week, and explain to those who may be getting duplicates it was an issue with "Solar Flares".... LOL

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com

Sponsor

They have: 178 posts

Joined: Feb 2005

Don't all MTA have some form of a log?

JeevesBond's picture
Moderator

He has: 3,516 posts

Joined: Jun 2002

Triexa.com wrote: Don't all MTA have some form of a log?

Hmmm, you might be right, maybe I should have investigated this better. On our server there's a /var/log/maillog, depending on your settings there should be a log on your server too Matt. Nice one Triexa. Smiling

Greg K wrote: explain to those who may be getting duplicates it was an issue with "Solar Flares"

Wasn't that an excuse used by the BOFH? Laughing out loud

a Padded Cell our articles site!

JeevesBond's picture
Moderator

He has: 3,516 posts

Joined: Jun 2002

Sorry for double-posting...
Having said the above, looking into our /var/log/maillog (and the archived maillog.1 etc.) they're completely empty! It might just be our strange server setup though, Plesk stores things in funny places (Plesk sucks).

a Padded Cell our articles site!

teammatt3's picture
Moderator

He has: 1,854 posts

Joined: Sep 2003

Oooo, I'll have to check that out (I don't have root access on this server so it might be a while) but I did a long listing on it, and it's 200 megs in size. This looks good Smiling

Thanks!!!

He has: 319 posts

Joined: May 2007

Dunno if you have come across Wufoo? They have some very nice forms, highly customizable, and free to bloggers and non-profits. You can host the form handling on their site, in which case every form sent is saved in an archive for later viewing; or they have copy-and-paste code for hosting on your own site.

They use the latest in anti-spam techniques as well. Worth checking out, IMHO.

Cordially, David
--
"Old web developers don't die, they degrade gracefully..."