Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic emailing 2

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
IE
Hi,

I put this question up yesterday as part of another thread but got no response so I said I'd try again as a new therad this time. I have put in an error handler routine throughout my application that it is working a treat. One question though, when the error trap routine is called, it throws up a message box telling the user that a terminal error has occured and that the application is about to close down. The message box just has an ok button which when pressed ends the application at that stage. What I would like to do now is similar to what the Microsoft products are doin at the moment i.e. put a "Send Error" button on the msgbox so that the error found could be sent automatically to our support desk. Firstly how would I put this button on a msgbox successfully (or do I need to call a different form instead of the msgbox to do this) and secondly, is there an ocx out there available to tie into outlook express to send off these types of mails automatically.
Again any help or suggestions would be greatly appreciated.

John B

 
Ok intresting question...i'm just working on a simple version of this!!

What i needed is exactly what u have described. Since i never found out how to add an extra button on the Message Box i decided to create a message box myself. Since time isn't very generous i had to create something fast, so here it goes..most probably its not the best version but at least i'll share my idea!!

What i did was i created a ActiveX DLL. Within the Dll i have a Form and a Class and a Module. The Form will act as a message box (which i re-desgned making it more appealing). The Class handles the interaction with the programmer and the Module takes care of certain functions...such as the email function.

I created the Form with the present msgbox in mind...so the programmer can choose the image, set the text, if its an OK or Cancel or Yes and No etc. All these are set up through a public function within the class. I also added an extra button which is the 'Send Error', where it could be set as visible or not.

The Class has functions and properties and Raising of Events. The Function are the Message per se: so it would have a function like: Class.Message "This is an Error", YesNo .....etc etc

Then when i use the New Message Box within a real system i created a Global function which will override the MsgBox, create an instance of the new Message Box (through the referenced Dll), set the New Message Box initial Properties: such as the email address where it should be sent etc.


Hope this helps; i know its like re-inventing the wheel but i liked the idea!! If you need any further info just ask

Nick


 
Hi Nick,

Sounds like a very tidy solution. Only thing is, like yourself, I don't have a lot of time to spend on this. I was thinking along the lines of putting a yes & no button on the message box with the caption "Do you want to send this error to the support desk". Then I was hoping that there was an ocx available somewhere that I could just tie into for the emailing purposes. Your way, sounds bang on correct, but it seems to be more work than I have time available - basically I was hoping for a quick fix to this.
By the way does your dll actually tie into outlook express and bring up a new message screen with the address already added. If so - could you give me some pointers on how to do that.

Thanks in advance
John B
 
Maybe I'm old fashioned....or also like nick like to re-invent the wheel, but I do all my emailing from code using the winsock control.

This makes my app independant from Outlook Express and independant from Correct Outlook accounts etc. (The user's machine might not allways have Outlook correctly configured)

So through winsock, I connect to a SMTP server and manually send what I want to send through my code to the SMTP server.

P.S. This offcourse might prove more difficult when you want to add attachments to your e-mails

Hope it helps, let me know

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
Not exactly ties with Outlook! I use a dll (forgot the name because i don;t have my pc availble), which by the way its free (if you want i send it to you), which send emails (send only!!). I just initialte the dll, set the email address and the message then you can add sender, sender email etc!!

If you want i can send the message box i created(its only $1000 ...hehe) ...it still lacks some error handling and stuff but i'm pretty sure you can add on it yourself!

nick

ps: I have a doc somewhere saying how you can send email via outlook express i will tell oyu in a minute ok!

 
Thanks very much Nick - anything you can send me on would be much appreciated - email address is jbrowne@appligenics.com.

x508 - your idea also interests me. I would not need to use attachments if you could set the body of the mail with the error message details. I'm not familiar with this winsock control though - perhaps you could give me more info on how it works and maybe some sample code.

Thanks Guys - things are looking up
John B
 
Hi Jbrowne

This is a link to the free dll for sending email i told you about:


Its the Vbsendmail.dll; there is an example and the dll uses the winsock x508 was talking about but obviously you will only see the intended interface like: sendmail, receipients etc! its fairly simple! No need to have outlook or express or any other email app installed!

Give me some time and i will send you an email with my Class! Zip compression is ok??

Nick
 
Yep zip compressed is fine - thanks very much for your help Nick.

John B
 
No Probs..thanks for the Star :>!! as i told you give me some time and i will send them!

good luck
nick
 
SendMail is the way to go, but just for your information, the MAPI controls allow iteraction with Outlook Express (or "Lookout", as it is known is these parts).

mmilan
 
jbrowne

About the Wiscock Control and E-Mail

U can use the winsock control to connect to a SMTP server on port 25(it's really straight forward)

Then u can search on google for SMTP protocol, to see how the standard works, in short (Phseudo Code)

Send string "helo" to the server
Send string "MAIL FROM:YourEmail@you.com"
Send string "RCPT TO:EMAIL@WHATEVER.COM"
Send string "DATA"
Send string (Message body)

to end send string VbCrLf & VbCrLf & "." & VbCrLf & VbCrLf

Message should now be sent

Hope it helps

P.S. By learning this method you can send email from anywhere, any pc, by using a telnet client, and connecting to an smtp server, and sending the strings



*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
excellent - thanks x508, I'll give that a try.

 
NP

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
Hi 58

I don't suppose you'd have time to help a real newbie...?

I'd love to be able to make use of the winsock controls but don't even know where to start.

I'm spending most of my time with VBA but would love to find a way or using this tool as it's cross platform (from the sounds of it).

[colorface]

----------------------------
Cogito Ergo Sum [jester2]
----------------------------
 
Since WinSock stands for Windows Sockets, I doubt it is all that cross platform.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top