View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas[_2_] Gary Keramidas[_2_] is offline
external usenet poster
 
Posts: 364
Default is there anyone that has successfully sent a page or a copied range using outlook express?

dave:

thanks for you efforts. it tries to send something, i don't know what, but
my email server rejects it because of authorization.

thanks anyways, like i mentioned, i'll just have them email manually, it's
only once a month and i just spent enough time on it to email sheets for 50
years.

--


Gary


"Dave Patrick" wrote in message
...
Give this a try;

Public Sub SendMail()
Dim objMessage
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "
objMessage.To = "
objMessage.TextBody = GetData

'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.keramidas.com"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==

objMessage.Send
Set objMessage = Nothing
End Sub

Function GetData()
Dim strTemp As String
'This is the column of our first cell.
x = 2
Do While Sheets("sheet1").Cells(4, x).Value < ""
strTemp = strTemp & Trim(Sheets("sheet1").Cells(4, x).Value) &
Space(1)
x = x + 1
Loop
GetData = strTemp
End Function

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Gary Keramidas" wrote:
| one other question:
|
| how come code posted on a lot of these websites never runs as posted?
there
| are always variables or something missing. half the time, that's the
hardest
| part for me to set up.
|
| --
|
|
| Gary