By creating the email directly in the mail.box database, it gets sent to the internet correctly. It also means you can also set who the email is from within the script.
Make sure you set the sender address correctly otherwise the email may be rejected by your SMTP host.
Sample code.
Sub Initialize
Dim sess As NotesSession
Dim db1 As NotesDatabase
Dim db2 As NotesDatabase
Dim doc2 As NotesDocument
Set sess = New NotesSession
Set db1 = sess.CurrentDatabase
'Create document directly within themail.box
Set db2 = sess.Getdatabase("ServerName", "mail.box", FALSE)
Set doc2 = New NotesDocument( db2 )
doc2.SendTo = "user@domain.com"
doc2.Recipients = "user@domain.com"
doc2.Subject = "Test Email via mail.box"
doc2.Principal = |"Order" <info@domain.co.uk>|
doc2.Form = "Memo"
doc2.From = "info@domain.co.uk"
doc2.Sender = "info@domain.co.uk"
doc2.ReplyTo = "info@domain.co.uk"
doc2.SMTPOriginator = "info@domain.co.uk”
Call doc2.Save(False, False,False)
End Sub
Thanks for the help.
Clive