Solved

POP mail without mail control?

Posted on 1998-07-26
5
195 Views
Last Modified: 2013-11-13
I would like to send mail directly to a pop mail server account without using the msmail control or any other control.  Can someone tell me the api calls or other way to do this without using an ocx?
0
Comment
Question by:LaurieT
  • 3
5 Comments
 

Author Comment

by:LaurieT
ID: 1466711
Thanks in advance,
Laurie
0
 
LVL 3

Expert Comment

by:SPECIALIST
ID: 1466712
Sub MapiSendMail()
           Dim objSession As Object
           Dim objMessage As Object
           Dim objRecipient As Object
           Dim sProfile As String
           Dim sSubjPrmpt As String
           Dim sTextPrmpt As String
           Dim sEmailPrmpt As String
           Dim sMsgTitle As String
           ' Leaving sProfile equal to Null will
           ' force the user to select which Mapi
           ' profile to use. To keep from being
           ' prompted, you must supply a valid
           ' user profile.
           sProfile = ""
           sEmailPrmpt = "Enter valid Email Name of message recipient:"
           sSubjPrmpt = "Enter the subject line for this message:"
           sTextPrmpt = "Enter the text for this message:"
           sMsgTitle = "Mapi Macro Example"
           ' Create the Session Object.
           Set objSession = CreateObject("mapi.session")
           ' Log on using the session object.
           ' Specify a valid profile name if you want to
           ' avoid the logon dialog box.
           objSession.Logon profileName:=sProfile
           ' Add a new message object to the OutBox.
           Set objMessage = objSession.Outbox.Messages.Add
           ' Set the properties of the message object.
           objMessage.Subject = InputBox(sSubjPrmpt, sMsgTitle)
           objMessage.Text = InputBox(sTextPrmpt, sMsgTitle)
           ' Add a recipient object to the objMessage.Recipients collection.
           Set objRecipient = objMessage.Recipients.Add
           ' Set the properties of the recipient object.
           objRecipient.Name = InputBox(sEmailPrmpt, sMsgTitle)
           objRecipient.Resolve
           ' Send the message. Setting showDialog to False
           ' sends the message without displaying the message
           ' or requiring user intervention. A setting of True
           ' displays the message and the user must choose
           ' to Send from within the message dialog.
           objMessage.Send showDialog:=False
           MsgBox "Message sent successfully!"
           ' Log off using the session object.
           objSession.Logoff
        End Sub

This is one way to do it.  Please note that where it says input box, you can make that a textbox, or you can hard code the email address or persons name etc.  If you need help doing that leave me a message!


David
0
 

Author Comment

by:LaurieT
ID: 1466713
I should have added 'without a profile or mail client installed' to my question.  I am familiar with MAPI.  If there are API calls I could make it would be better.  I need it to run on an NT server or workstation without an exchange client installed.  Like let's suppose they are using a different mail client and are not logged in.
0
 
LVL 1

Accepted Solution

by:
Aikema earned 90 total points
ID: 1466714
You 'd have to look at these files and sent the proper commands to the server in order to send mail:

http://eduserv.kahoslg.be/cfk/rfc's/rfc0937.txt
http://eduserv.kahoslg.be/cfk/rfc's/rfc1225.txt
http://eduserv.kahoslg.be/cfk/rfc's/rfc1725.txt

These three files contain all the commands pop2 or pop3 servers will accept

Would the winsock control work for you to use?  That way you'd still have to use a control but not need to have a mail program on those computers.  I can't think of any way to use the api alone to send the messages.
0
 

Author Comment

by:LaurieT
ID: 1466715
This is the root of the answer.  Thanks - I'll be off researching the rest  :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

808 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