-
I use the following code to send email:
mps.SignOn
mpm.SessionID = mps.SessionID
mpm.Compose
mpm.RecipAddress = "[email protected]"
mpm.ResolveName
mpm.MsgSubject = "Subject"
mpm.MsgNoteText = " "
mpm.AttachmentIndex = 0
mpm.Send True
It works fine, except it will prompt out the outlook screen
and need me to press "Send" button.
1) Is there anyway to automatically send without press the button?
2) I am not sure whether the above code can work with Netscape,
I only tried with Outlook, does anybody can tell me whether it can work?
Thanks
-
If you are only using outlook you can use this:-
Dim objOutlook As New Outlook.Application
Dim ObjOutlookMag As Outlook.MailItem
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = Rst1!Email
.Subject = "test"
.Body = "Line1 "& vbNewLine & vbNewLine
.Body = .Body & "Line2" & vbNewLine
.Body = .Body & "Line3" & vbNewLine & vbNewLine
.Send
End With
Set objOutlookMsg = Nothing
'Close Outlook instance
Set objOutlook = Nothing
you will need to include "Microsoft Outlook *.0 object Lib" in your project referances.
-
Sorry that should have read:
Dim objOutlook As New Outlook.Application
Dim ObjOutlookMag As Outlook.MailItem
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "[email protected]"
.Subject = "test"
.Body = "Line1 "& vbNewLine & vbNewLine
.Body = .Body & "Line2" & vbNewLine
.Body = .Body & "Line3" & vbNewLine & vbNewLine
.Send
End With
Set objOutlookMsg = Nothing
'Close Outlook instance
Set objOutlook = Nothing