jhsachs Posted August 2, 2011 Share Posted August 2, 2011 I'm writing code that sends a moderately complex email (HTML and plain text parts, and an attachment). This is the first time I've worked with MIME headers, and I anticipate a difficult time getting the output right. The testing cycle will be slowed down by the fact that each test will require sending an email and waiting for it to arrive. Then I'll have to deduce what is wrong from the behavior of the mail reader, which is essentially a black box. Are there any tools which will improve the process, for example, by analyzing a set of mail() parameters and telling me whether they conform to MIME syntax? Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/ Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 Not sure about tools being available, but in those situations, what I do is: 1. Use gmail for testing (emails arrive within 1 second so there's not much waiting time) 2. start with a base that works, and add my stuff gradually, testing after adding every line. instead of writing all the code and then trying to find the problem, I find it easier to add a line at a time, and keep testing, so I always know where the problem is. I know this is not what you asked, but hey, just thought I would shout it out, in case you don't find any cool tools. Hope it helps Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1250655 Share on other sites More sharing options...
jhsachs Posted August 2, 2011 Author Share Posted August 2, 2011 Well, that's not what I asked, but it's probably what I should have asked! I still hope somebody comes up with a tool, but everything you said is practical and helpful. I have to write some moderately complex code to get the flexibility I need, so adding a line at a time isn't practical, but I can debug by calling my mail function with simple requests and work up from there. Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1250669 Share on other sites More sharing options...
ignace Posted August 2, 2011 Share Posted August 2, 2011 Take a look at hMailServer. At work I use yet another program but I can't find it by a quick search on the net and I can't recall the name. I'll update this topic as soon as I get the name. EDIT: The program's name is Papercut. The website currently returns a 404. Darn. EDIT 2: It's now hosted on CodePlex: http://papercut.codeplex.com/ Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1250856 Share on other sites More sharing options...
jhsachs Posted August 3, 2011 Author Share Posted August 3, 2011 Thank you, Ignace. I'm not sure I'll need hMailServer for this task, but I'll it sounds like a useful tool to keep in my toolkit. Right now my attention is focused on the other end of the process: having sent an email, how can I tell whether it's right? I can imagine a server validating the headers before sending the message, but I didn't see anything in my (very superficial) inspection of hMailServer that suggested such a capability. The ideal tool would receive a message and tell me exactly what, if anything, is wrong with its headers. Failing that, I need to deduce that information from the behavior of a conventional email reader. A simpler but still useful tool would be a mail reader that displays all of the headers "raw." I could use it to display a certain type of message sent from another mail reader, and thus known to be good, and compare its headers to those generated by my code for the same type of message. If I'm careful, I can find any errors that way. I've started debugging, and the first problem I face is: how can I tell whether the plain text component of a message is correctly formatted? My standard mail reader is Eudora, and it apparently has no option for forcing the display of plain text. I need to find a way to display the plain text part of an email that has an HTML part, simulating the behavior of a reader that cannot display HTML. Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1251082 Share on other sites More sharing options...
ignace Posted August 3, 2011 Share Posted August 3, 2011 http://www.campaignmonitor.com/testing/ Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1251098 Share on other sites More sharing options...
jhsachs Posted August 3, 2011 Author Share Posted August 3, 2011 Ignace, heir documentation led me to an answer to my question. Consequently I don't need their tool now, but again, it looks like a very useful thing to have. Thanks again! You're a champ! Quote Link to comment https://forums.phpfreaks.com/topic/243555-tools-for-debugging-calls-to-mail/#findComment-1251242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.