|
-
December 19th, 2011, 06:52 PM
#1
[RESOLVED] Send email VB6
Hello all
I'm trying to modify this part of the code:
Instead of putting the email in the code, i would like to use a text1 where i can put a custom address, directly in my Form4.email_le_vignoble.Text.
how can i do that?
I have tried like this:
Code:
Set OLRecipient = OLNameSpace.CreateRecipient.Form4.email_le_vignoble.Text
But i have the compile error " Argument not Optional"
Thanks again
Thanks again for your help
-
December 20th, 2011, 02:47 AM
#2
Re: Send email VB6
Code:
Dim strEmail as String
strEmail = """ & Form4.email_le_vignoble.Text & """
-
December 22nd, 2011, 06:06 PM
#3
Re: Send email VB6
Hello dglienna
This is perfect. Now it working perfectly
Code:
Dim OLApp As Outlook.Application
Dim OLNameSpace As Outlook.Namespace
Dim OLRecipient As Outlook.Recipient
Dim OLAppt As Outlook.AppointmentItem
Dim strEmail As String
Set OLApp = New Outlook.Application
Set OLNameSpace = OLApp.GetNamespace("MAPI")
OLNameSpace.Logoff
OLNameSpace.Logon "Logon Name", "Password", False, True
'emai
strEmail = """ & Form4.email_le_vignoble.Text & """
Set OLAppt = OLApp.CreateItem(olAppointmentItem)
Thanks again for your help
-
December 29th, 2011, 07:11 PM
#4
Re: [RESOLVED] Send email VB6
You can go on with this following code .it works like a charm for me .really nice code to send email using Ms outlook .
Code:
Option Explicit
Private Sub Form_Load()
Call SendMailUsingOutLook
End Sub
Public Sub SendMailUsingOutLook()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "[email protected]"
.Cc = "[email protected]"
.Subject = "Sending Emails using Outlook."
.Body = "find this email"
.HTMLBody = "HTML version of message"
.Attachments.Add ("c:\imp.txt")
.Send 'Let´s go!
End With
Set objOutlookMsg = Nothing
End Sub:wave:
-
January 6th, 2012, 08:13 PM
#5
Re: [RESOLVED] Send email VB6
Hello firoz.raj. Let me try this and i will let you know the result
Thanks
-
January 9th, 2012, 03:31 PM
#6
Re: [RESOLVED] Send email VB6
before i post i have checked the code .this code working like a charm.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|