stever1725
Technical User
Anyone who could help.. i have researched but cannot seem to get this resolved. i am getting **Run-Time error '450' Wrong number of arguments or invalid property assignment** on debug the .Attachment line is highlighted. Can somenone give me some insight to this? if i take out this line i do get an email sent.. i need to be able to attach a file. please help. thanks steve
Option Compare Database
Public Function mailtest()
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item(" = 2
.Item(" = "mailserver.test.net"
.Item(" = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "sgarcia@test.com"
.BCC = ""
.From = """Steve Garcia"" <test@test.net>"
.Subject = "Test Email"
.TextBody = "This is a test"
.Attachments.Add "C:\CPASO.xls", olByValue, 1
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function
Option Compare Database
Public Function mailtest()
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item(" = 2
.Item(" = "mailserver.test.net"
.Item(" = 25
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "sgarcia@test.com"
.BCC = ""
.From = """Steve Garcia"" <test@test.net>"
.Subject = "Test Email"
.TextBody = "This is a test"
.Attachments.Add "C:\CPASO.xls", olByValue, 1
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function