Solved

VB / CDO - How to send an EMail

Posted on 2007-03-20
3
1,085 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month3 days, 11 hours left to enroll

630 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