11-09-2001, 10:18 AM
I am using Outlook objects to send emails via my program. But this is bringing me huge limitations :
I can only refer to one version : Office 97 will not work if I chose to join Office 2000 dll's in my project.
Some Outlook applications advise the user when attempting to send automatically an email.
This brought me to the point of considering : Is there a way to send mails without even referring to Outlook at all ?
11-09-2001, 10:54 AM
Sure, several ways:
You could use a tool like IDSMail at http://www.intuitive-data.com
OR, you could use MAPI directly:
Place a MAPI Session and a MAPI Message control on your form.
On Error Resume Next
.UserName = "MyName"
.Password = "MyPassword"
If Err <> 0 Then
ErrorMessage = "Error during MAPI signon - " & Error$
MAPIMessages1.SessionID = .SessionID
.RecipDisplayName = "XXX@YYY.COM"
.MsgSubject = "Hello there"
.MsgNoteText = "This is the body of the message"
11-09-2001, 11:42 AM
And does this require a new dll ?
Because my program is already distributed and I am trying to make my updates via a new EXE as much as possible...
11-09-2001, 11:48 AM
This would require MSMAPI32.OCX. I'm not sure if there's a .DLL associated with that.....
You could check by building a small project with the two controls, use the VB package deployment wizard and see what components are included.....
11-09-2001, 10:59 PM
To send and recieve email WITHOUT using Outlook or MAPI
Sending mail is done by the POP3 protocol and recieving is done by the SMTP protocol. In general this is how an email app will communicate with an email server and retrive email.
1. Connect to the email server in the correct port (POP3 > port number =110)
2. Login as a user
3. Send commands to recieve mail
This is fairly simple. You can do this with winsock or Telnet. To this through Telnet this is what you should do.
connect to 'pop.mail.yahoo.com'; port '110'
you will get a reply something like '+OK'
then you have to login, for that type this
you will get a reply like '+OK'
then enter the password like this
you will get a positive reply if the username and password is correct else something like '-ERR'
if you get an error you have to try again, If the login is success full you will get a reply. You should get a reply like '+OK' and some other data continuing this telling you how many mails are there.
To retrieve the whole mail you have to type
you will get the whole message as it is in the server. The mail will be in a standard format that is accepted by all the people who use the internet. For more information about the format go to'www.faqs.org' and search throught the RFC's.
To delete a message
the server will delete the message
to quit type
the server will logout and your connection will be closed
These commands can be sent via winsock with a little bit of programming knowledge. The servers replies can be retrieved from the Getdata function and you can send commands with the Senddata function.
The commands I listed above are few of the commands. To see the whole lot of command I suggest you to go to 'www.faqs.org' and look for the 'RFC 1939'
To send mail through SMTP I think there was a tute by ChiefRedBull or someone else. Check that.
To get the whole commands of the SMTP protocol go to 'www.faqs.org' and look for 'RFC 821'
I was in a hurry to tell everyone that there is a wat to send mail without using Outlook. I have alson included the two webpages that have the POP3 and SMTP commands and how they are to be used to get positive results. I hope I will be able to complete a project that will send and recieve mail using these concepts. But now I have to turn off the computer and study for my O-Level exams next year. Any comments are welcome!
11-10-2001, 06:53 AM
Theres a short intro to the SMTP protocols via HotMails free service in the tutors corner. it doesn't go into attachments, but everything else is covered. Theres even a sample telnet app that you can practice with.