This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Sep 10, 2018, 8:50 PM
6 Posts
topic has been resolvedResolved

Internet Email Agent

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role:
  • Tags:
  • Replies: 5

Hi

I'm try to create a scheduled agent on my server that sends an email to an internet email address.

Server 9.0.1 FP9 have tried FP10 as well.

When I run the agent manually, it works correctly. However, when I schedule the agent it fails.

 Router: No messages transferred to AUTH.SMTP.1AND1.CO.UK (host AUTH.SMTP.1AND1.CO.UK) via SMTP
 Router: Error transferring message 00707069 via SMTP to AUTH.SMTP.1AND1.CO.UK  Invalid Internet address specified.

This is the code.

Dim sess As NotesSession
    Dim db As NotesDatabase
    Dim doc1 As NotesDocument
        
    Set sess = New NotesSession
    Set db = sess.CurrentDatabase
    
    'send email
    Set doc1 = New NotesDocument( db )
    doc1.Form = "Memo"
    Print "Test email agent "
    
    doc1.SendTo = "user@domain.com"
    doc1.Subject = "Email Test"
    Call doc1.Send( False )

I have enable these debug settings in the notes.ini on the server, but they don't give me any more clues.

SMTPDebug=3
DEBUGROUTER=3

 

I have tried the following.

1. Signing the agent with my ID and the server ID but it makes no difference. I get the same error.

2. Formatting the address <user@domain.com>

I believe I have all the correct settings in my server document, but have run out of ideas.

 

Any advice would be gratefully received.

Thanks,

Clive.

Sep 12, 2018, 1:36 AM
326 Posts
suggestion

Stop the router and compare the 2 emails that are in the mail.box for missing or different fields

Sep 13, 2018, 8:31 PM
6 Posts
Router

That was a good idea, stopping the router.

I sent one email from my own mail database, and one from the automatic agent.

The first obvious difference was in the default mail.box view. One of the columns did not show me the value of the sendto field I expected to see, it showed the value of the recipients field.

The one from my agent had the email address but wrapped with <>. So there was an obvious difference with the two emails.

Where does the recipients field come from, my agent did not add it and the router was not running, but it was on the document.

I tried setting that field in my agent, but that did not work either.

The other thing I found different was that the email from my mail database had several MIME fields, presumably because this is set in my location document.

Maybe I have to change my agent to send the email in MIME format, but not sure why I should have to change the format, I would have thought the email should still be sent regardless of the format.

I will have to do some research in formatting in MIME.

Thanks for your advice.

Clive

Sep 13, 2018, 9:00 PM
326 Posts
Strange

When send from client it uses location doc so thats why you get mime.   Scheduled should work no issues

 

Recipients gets filled in by doc.send

 

try this

 

Dim recipients(1 to 3) As String

recipients( 1 ) = "Jim Dinauer"

recipients( 2 ) = "Betty Dinauer"

recipients( 3 ) = "Mary Sticka"

Call doc.Send( True, recipients )

 

You can always create the doc in mail.box but something strange is going on .

Here is one of many examples out on the internet http://blog.texasswede.com/lotusscript-mail-notification-class/

 

Sep 14, 2018, 9:44 PM
6 Posts
Internet Email Agent

Hi.

I have already tried setting the recipients value in my agent and it made no difference.

I have another thought on whats causing my issue.

Could the server anti-relay settings be to stringent, or would that cause a different error.

I keep changing settings in the address book to try the anti-relay feature, but what I need is a way to just turn off that feature as I don't have the SMTP listener function enabled anyway.

I will look at the link you sent me and also try creating my email directly in the mail.box and see what happens.

Thanks

Clive

Sep 27, 2018, 10:11 PM
6 Posts
Internet Email - Solved

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


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal