sending bug report as email

Started by
8 comments, last by LackOfGrace 15 years, 11 months ago
so ive been revamping my development framework, mainly the most basic componentes. and ive hit a snag on bug reporting, i dont know wich way i should send them. the nicest way i think would be to send the bug report as an email from the application, this way i could easily setup a email account without having a server. this seems to be a problem though since ( according to the information i found ) i have to use a smtp server to send it ( or atleast know the target smtp server ) its here that im getting lost, isnt smtp just a protocol? why cant i just send an "email" to a certain ip? ( i would really like an explanation on this ) i also found it wierd that i couldnt find any lightweight libraries for this. it must be that im searching with the wrong keywords. another way of sending the bug report could be sending it to a php/asp server, wich stores the bug report ( or emails it ) in a database. i dont know if this method is able to send files ( such as a screenshot of the error and the log file ) but it should be simpler than the email sending , but i need to have a server for this. i really like the email solution better, but what do you think?
Advertisement
Quote:Original post by LackOfGrace
so ive been revamping my development framework, mainly the most basic componentes.
and ive hit a snag on bug reporting, i dont know wich way i should send them.

the nicest way i think would be to send the bug report as an email from the application, this way i could easily setup a email account without having a server.

this seems to be a problem though since ( according to the information i found ) i have to use a smtp server to send it ( or atleast know the target smtp server )

its here that im getting lost, isnt smtp just a protocol?
why cant i just send an "email" to a certain ip?
( i would really like an explanation on this )

i also found it wierd that i couldnt find any lightweight libraries for this.
it must be that im searching with the wrong keywords.

another way of sending the bug report could be sending it to a php/asp server, wich stores the bug report ( or emails it ) in a database. i dont know if this method is able to send files ( such as a screenshot of the error and the log file ) but it should be simpler than the email sending , but i need to have a server for this.

i really like the email solution better, but what do you think?
SMTP is a protocol, yes. You can send an E-mail to a specific IP address, if you know the IP address to send to. However, most SMTP servers on the Internet won't accept connections from just anyone, because otherwise they'd be overwhelmed by spam. Instead, you need to send E-mail to your ISPs SMTP server, and they'll relay it for you.

If you run your own SMTP server, you could send E-mails to it directly (I've written an SMTP server before, it's very simple). However, you'll get a lot of spam (I was getting 20-50 spam mails a day, and over 200 connections).

I think the PHP/ASP script would be a more sensible approach.
One other option you have for sending emails is to write code to launch the users default email program with your email ready for them to send. That also lets them easily add comments and attachments (e.g. screenshots) to the bug report.

To do that just ShellExecute() an appropriate mailto: URL.
ive thought about that to, but there are problems with this appoach.
firstly i personally think its annoying when a program opens outlook since ( Secondly ) many people use a web email client.

thirdly i would like the user to write information into a form so i can expect a standard layout of the bug reports

php + database seems to be the way so far, the only catch with that is that it isnt as pretty and developer friendly as email sending
How about you send it as an HTML post with all the info attached? You can then design a custom form (in whatever) that then reformats it for HTTP.
Quote:Original post by LackOfGrace
thirdly i would like the user to write information into a form so i can expect a standard layout of the bug reports


The less work your users have to do to help you, the more likely they'll be to help you, imo. To that end, craft your crash reporter to log the information you want into the kind of layout that you want. How do you do that? Here are a few links to an expert's approach to the topic.

Matt Pietrek, Under the Hood, April 1997 Describes a basic framework for intercepting unhandled exceptions and writing a report file with some basic information.

Matt Pietrek, Under the Hood, May 1997 provides some follow up on the previous article.

Matt Pietrek, Improved Error Reporting with DBGHELP 5.1 APIs provides an update of the previous two articles.

Here's my straight C adaptation of the first article: UEH.

Another Guru on this topic is John Robbins, author of Debugging Applications. He wrote the code that eventually wound up here: google code: crashrpt A crash report and customer feedback system for Windows applications.

And here are a couple more links to similar programs that I haven't tried and cant vouch for.

Add Crash Reporting to Your Applications with the CrashRpt Library

Add Crash Reporting to Your Applications

I don't think any of these articles detail how to send the crash report back to you, but I've seen other tutorials that went ahead and fussed with smtp. Sorry, no links at the moment.

If the user is given the option to launch outlook in order to transmit the crash report, it's no more annoying than any other popup message.

"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
i already have all the information i requier ( stack, screenshot, logfile and user description )

for now im starting a new window wich explains that the application crashed, the user may then enter a breif description and then click "send" to send the report or "cancel" to cancel it.

so the only thing left is getting this information to me ( or another developer using my code )

and here im stumped since network coding isnt my preffered area.

i am currently testing a simple smtp send from the application, we will se how it will end up

[Edited by - LackOfGrace on May 29, 2008 2:58:02 AM]
seems that im only able to get a
421 error from all the smtp servers ive tried connecting to
this is becouse they think im spam?

im connecting to mail.domain ( mail.hotmail.com etc. )
at port 25

i then wait for the handshake, and at that point i get

421 Cannot connect to SMTP server 195.47.247.72 (195.47.247.72:25), connect error 10060

i cant even ping these ip's...
could it be that gethostbyname() resolves an old ip or something?


EDIT:
ok, got it working now, seems i misunderstood the naming of smtp servers.
so, yeah. im getting the handshake now, now for some text

[Edited by - LackOfGrace on May 29, 2008 4:52:38 AM]
Quote:Original post by LackOfGrace
seems that im only able to get a
421 error from all the smtp servers ive tried connecting to
this is becouse they think im spam?

im connecting to mail.domain ( mail.hotmail.com etc. )
at port 25

i then wait for the handshake, and at that point i get

421 Cannot connect to SMTP server 195.47.247.72 (195.47.247.72:25), connect error 10060

i cant even ping these ip's...
could it be that gethostbyname() resolves an old ip or something?
You can't send mail directly to a mail server, it's very unlikely to work (It appears hotmail works though). You need to send mail either directly to a server that you KNOW will accept the connection (I.e. run the server yourself), or relay it via the user's ISP's SMTP server.

This is one of the many reasons I wouldn't recommend sending an E-mail to do crash reports.
yeah, hotmail isnt open, i connected to another email wich runs pop3
sadly the connection ive gotten is for reading emails, not sending them :(


back to the drawing table

thanks for the help guys

This topic is closed to new replies.

Advertisement