?
Solved

POP mail without mail control?

Posted on 1998-07-26
5
Medium Priority
?
199 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
[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
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 360 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

800 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