Solved

VB5 Class to send email and not need Outlook

Posted on 1998-12-18
10
212 Views
Last Modified: 2010-05-03
Can the person who said they would send me a VB5 class please send it to me?
The class is to allow VB5 to send email without requiring Outlook to be on the PC.
Thanks
DoughBoy
0
Comment
Question by:DoughBoy
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 1

Accepted Solution

by:
CarlosJac earned 50 total points
ID: 1451368
DoughBoy:

 I 've just sent you the class
0
 
LVL 15

Expert Comment

by:ameba
ID: 1451369
Can the other experts see this?
0
 
LVL 1

Expert Comment

by:MAVERICK
ID: 1451370
sure can!

0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:DoughBoy
ID: 1451371
CarlsJac,

   I know it's been a month,  but I finally got around to testing your EmailHandler Class and still have the mail sent to outlook instead of to the email address.  

   What am I doing wrong?

Thanks
DoughBoy
0
 
LVL 1

Expert Comment

by:CarlosJac
ID: 1451372
DoughBoy:

Show me your code, please

thank you
0
 

Author Comment

by:DoughBoy
ID: 1451373
I am using your class,  so you should be familiar with what are in the actual function calls.  Also,  of course, I am using a false ID and Password since we are on the internet right now.
   
    Dim retval As Integer
    Dim myEmail As EmailHandler
   
    Set myEmail = New EmailHandler
   
    retval = myEmail.OpenSession("TempUserID", "MyPword", True, True, True)
    retval = myEmail.SendMail(Trim$(txtSubject.Text), Trim$(txtMessage.Text), Trim$(txtSendTo.Text), "", "", True)
    retval = myEmail.CloseSession
 
I am just trying to get the basics done before I make the code more complicated.  One thing I noticed is that I received an error message saying my profile name was not correct.  When I ran the function GetDefaultProfile,  it brought up "Microsoft Outlook." After pressing OK,  it then opened Outlook express and copied the email message to a file in the CreateMessage Section of Outlook.

Your help is appreciated.
Thanks

0
 
LVL 15

Expert Comment

by:ameba
ID: 1451374
0
 
LVL 1

Expert Comment

by:CarlosJac
ID: 1451375
Try:

    Dim retval As Integer
    Dim myEmail As EmailHandler
     
    Set myEmail = New EmailHandler
     
    retval = myEmail.OpenSession("TempUserID", "MyPword", True, False, False)
    retval = myEmail.SendMail(Trim$(txtSubject.Text), Trim$(txtMessage.Text), Trim$(txtSendTo.Text), "", "", True)
    retval = myEmail.CloseSession

Note this:  in OpenSession call, the arguments 4 and 5 are False.
If the argument 4, force to do a new session.  If it is True, use an existent session (eg: Outlook Session).  Perhaps, this change resolve your problem.
Say me the results ...
Good luck, and excuse me (my english is very poor)

0
 

Author Comment

by:DoughBoy
ID: 1451376
Hello CarlosJac,

  Well,  there are now no error messages.  Unfortunately,  it still brings up the MS Outlook program.  And do not worry,  you english is fine.

Thanks
DoughBoy

0
 
LVL 4

Expert Comment

by:wileecoy
ID: 1451377
Was this resolved?

I am interested in the answer, but it looks like the answer was never posted.

I've already paid points for the answer, I guess just a yes/no would do, and if it's no (that the answer is not posted), can he who holds that answer send it to me??

norman_floria@rsmi.com

Thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question