SendMail Macro

B

Benoti

Hello,

I created this macro

==============================================

Sub Send_Form()
'
' Send_Form Macro
' Macro recorded 6/8/2004 by No One
'
info1 = Range("F5").Value
info2 = Range("F7").Value
info3 = Range("F9").Value
info4 = Range("F11").Value

ActiveWorkbook.SendMail "(e-mail address removed)", " " & info1
& " / Account no: " & info2 & " / Temp. no: " & info3
& " / Ported no: " & info4 & "."
'
End Sub

==============================================

It works fine. However, it sends the form as an
attachement. Is there a way for me to have it sent
directly in the e-mail (no need to open up a document)???

Thanks!!!
 
G

Greg Koppel

Dim ol, MailSendItem, olns, olMailItem
Dim today As Date
Dim mySubj, myAddr, myBody, myAttachments
Dim myFile

Sub NewMail()
Set ol = CreateObject("Outlook.Application")
Set MailSendItem = ol.CreateItem(olMailItem)
Set olns = ol.GetNamespace("Mapi")

mySubj = Range("B2")
myAddr = Range("D2")
myBody = Range("A1")
With MailSendItem
.Subject = mySubj
.Body = myBody
'.htmlbody = "<HTML><H2>My HTML page.</H2><BODY><IMG
SRC=""WBHats.jpg""></BODY></HTML>"
.To = (e-mail address removed)
.attachments.Add "C:\temp\wb_logo\WBHats.jpg"
'.CC = "(e-mail address removed)"
'.Attachments.Add "C:\temp\011302.zip"
.Send
End With
End Sub

Regards, Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top