Hej Flg function sender mails udenom outlook:
Du sakl blot angive de argumenter du ønsker
NBNB!! husk at indsætte IP adressen på en SMTP server der hvor der er:
???.???.???.???
Public Function SendCDOMail(ByVal Fromadr As String, ByVal Toadr As String, ByVal SubJ As String, ByVal TxtBody As String, Optional Attachment As String)
SendCDOMail = False 'assume error
On Error GoTo err_SendCDOMail
dim SMTPserver
SMTPserver = "???.???.???.???"
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = SubJ
objMessage.From = Fromadr
objMessage.To = Toadr
objMessage.TextBody = TxtBody
If Not (IsNull(Attachment) Or "" = Attachment) Then
objMessage.AddAttachment Attachment
End If
'==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 Remote SMTP Server
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPserver
'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
SendCDOMail = True 'mark success
Exit Function
err_SendCDOMail:
SendCDOMail = False 'assume error
Exit Function
End Function