Solved

VB / CDO - How to send an EMail

Posted on 2007-03-20
3
1,084 Views
Last Modified: 2013-11-26
Using CDO 1.2.1 how can we programmatically create and send a mail which uses an Outlook Custom Form stored in the Organizational Forms library ?
0
Comment
Question by:Madmarlin
[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 Comments
 
LVL 14

Expert Comment

by:raja_ind82
ID: 18754930
0
 
LVL 11

Expert Comment

by:Louis01
ID: 18756372
I don;t know how you can use outlook stationary, but here is how you can create and send an email with a HTML Body:

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
            Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

            'Authenticate if necessary
            'objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = smtpServerName
            'objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = smtpPassword
           
            'Outgoing SMTP server configuration      
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "sendmail.brinkster.com"
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
            objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
            objCDOSYSCon.Fields.Update

            'Update the CDOSYS Configuration
            Set objCDOSYSMail.Configuration = objCDOSYSCon
            objCDOSYSMail.From = "validaddress@thisdomain.com" 'This has to be valid on the selected SMTP server
strHTML = "<table class='h'><tr><td class='l'></td><td>" & _
                 "<li><a href='abc'>Open Questions</a> (0)</li>" & _
                 "<li><a href='xyz'>Question History</a> (1)</li>" & _
                 "</td></tr></table>"
            objCDOSYSMail.To = "validaddress@validdomain.com"
            objCDOSYSMail.Subject = strSubject
            objCDOSYSMail.HTMLBody = strHTML
            objCDOSYSMail.Send
0
 
LVL 1

Accepted Solution

by:
Madmarlin earned 0 total points
ID: 18756862
I manage to find the answer myself..
(Quite simple afterall)

Outbox.Messages.Add(Type="IPM.Note.MyFormName")

Question now closed.
Thanks Madmarlin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

738 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