?
Solved

Email

Posted on 1999-01-16
6
Medium Priority
?
155 Views
Last Modified: 2010-05-03
I need the code to send email from one computer to another that are both connected to the internet.  I want to send an email to screen name "test@test.com" with a subject of "test" and a message of "Test works".  I am just a beginner so can you please explain it so even a beginner can understand?
0
Comment
Question by:MChu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 1

Accepted Solution

by:
Johnn earned 440 total points
ID: 1468965
First, goto ms' VB site and get the active messaging library which I believe uses Exchange so as long as you have an exchange profile set up on your win9x machine this should work.

Add a reference to the Active Messaging to your project add this function and call it like this:

Dim Success as Boolean
Success=SendEmail(ProfileName,ProfilePassword,SendToEmailAddress,Subject,Msg)

where:
ProfileName=the ms exchange profile you are using
ProfilePassword=the password of the above profile
.the rest s/b straight forward

Function SendEmail(UserName$, Password$, EmailAddress$, sSubject$, sMsg$) As Boolean
    Dim objSession As Object    ' Session object
    Dim objMessage As message    ' Message object
    Dim objOneRecip As Object   ' Recipient object
     
    On Error GoTo error_olemsg
     
    ' create a session then log on, supplying username and password
    Set objSession = CreateObject("MAPI.Session")
    objSession.Logon UserName, Password
     
    ' create a message and fill in its properties
    Set objMessage = objSession.Outbox.Messages.Add
    objMessage.Subject = sSubject
    objMessage.Text = sMsg
    '' create the recipient
    With objMessage.Recipients.Add
        .Name = EmailAddress
        .Type = mapiTo
        .Resolve
    End With
    ' send the message and log off
    objMessage.Update
    objMessage.Send showDialog:=False
   
    objSession.Logoff
    SendEmail = True
    Exit Function
     
error_olemsg:
    'MsgBox "Error " & Str(Err) & ": " & Error$(Err)
'    server.SendText Socket, "SENDEMAILERR"
    SendEmail = False
    Resume Next
 
End Function

John
0
 

Author Comment

by:MChu
ID: 1468966
I am sorry, I don't understand what exactly I have to dl from the Ms vb site.  Can you please link me directly to the site. Thank you
0
 
LVL 1

Expert Comment

by:Johnn
ID: 1468967
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:MChu
ID: 1468968
Is there any way to do this without using Exchange.  Also can you link me to where I can dl it?  Thanks for your help so far.
0
 
LVL 1

Expert Comment

by:Johnn
ID: 1468969
There's other ways but I only use exchange...

that was the link
try just downloads then(you might have to be registered)
http://msdn.microsoft.com/vbasic/downloads

0
 

Author Comment

by:MChu
ID: 1468970
Adjusted points to 110
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

771 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