Send email agent does not work: No route to domain xyz.com

hi,I have a simple agent which is meant to send emails to users based on certain condition.

It works fine if it is run on its own i.e right click>run.

But when it is placed in a WebQueryOpen in a Web Form, it gives me the followinf popular message

No route found to hotmail.com: Check Server, Connection and Domain documents in Domino Directory.

I have set the Mail Routing option to SMTP and also enabled the SMTP Listener task.

The following is the code (taken directly from one of the IBM developers solution page):

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim body As NotesMIMEEntity

Dim header As NotesMIMEHeader

Dim stream As NotesStream

Set db = s.CurrentDatabase

Set stream = s.CreateStream

s.ConvertMIME = False ' Do not convert MIME to rich text

Set doc = db.CreateDocument

doc.Form = "Memo"

Set body = doc.CreateMIMEEntity

Set header = body.CreateHeader("Subject")

Call header.SetHeaderVal("HTML message")

Set header = body.CreateHeader("To")

Call header.SetHeaderVal("psarfaraz@hotmail.com")

Set header = body.CreateHeader("Principal")

Call header.SetHeaderVal("test@salvationarmy.org.uk")

Set header = body.CreateHeader("From")

Call header.SetHeaderVal("test@salvationarmy.org.uk")

Set header = body.CreateHeader("SMTPOriginator")

Call header.SetHeaderVal("test@salvationarmy.org.uk")	

Set header = body.CreateHeader("Sender")

Call header.SetHeaderVal("test@salvationarmy.org.uk")	





Call stream.writetext(|<HMTL>|)

Call stream.writetext(|<body bgcolor="blue" text="white">|)

Call stream.writetext(|<table border="2">|)

Call stream.writetext(|<tr>|)

Call stream.writetext(|<td>Hello World!</td>|)

Call stream.writetext(|</tr>|)

Call stream.writetext(|</table>|)

user$ = s.CommonUserName 'if scheduled agent this returns the name of the server

'Below uses the ampersand (&) to concatenate user$

Call stream.writetext(|<br><font size="+5" color="red">You have unread messages to approve</font>|) 

Call stream.writetext(|</body>|)

Call stream.writetext(|</html>|) 

Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT) 

Call doc.Send(False)

s.ConvertMIME = True ' Restore conversion - very important

End Sub

any help would be appreciated.

thanks,

saf

Subject: @Internet

append @Internet to the mail addresses

Subject: @Internet

thanks jean for the response.could you please point me to where exactly I need to be appending it.

Is @Internet not a formula language?

thanks,

saf

Subject: .

personxyz@hotmail.com@internet

Subject: @internet

ok jean,ill trey it out and let you know.

thanks,

saf

Subject: Still does not work - Memo.send()

hi,I have simplified the agent as following and it still gives me the same error i.d

No route to domain name.Check Server, Configeration etc.

The agent works if it is run manually but does not when it is instigated from a WebQueryOpen.

Here is the code of the agent:

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim body As NotesMIMEEntity



Dim header As NotesMIMEHeader

Dim stream As NotesStream

Set db = s.CurrentDatabase

Set stream = s.CreateStream

s.ConvertMIME = True

Dim memo As New NotesDocument(db)

Set body = memo.CreateMIMEEntity

Call body.SetContentFromText(stream, "text/html",ENC_NONE)

Call stream.writetext(|<HMTL>|)

Call stream.writetext(|<body bgcolor="blue" text="white">|)

Call stream.writetext(|<table border="2">|)

Call stream.writetext(|<tr>|)

Call stream.writetext(|<td>Hello World!</td>|)

Call stream.writetext(|</tr>|)

Call stream.writetext(|</table>|)

'if scheduled agent this returns the name of the server

'Below uses the ampersand (&) to concatenate user$

Call stream.writetext(|<br><font size="+5" color="red">You have unread messages to approve</font>|) 

Call stream.writetext(|</body>|)

Call stream.writetext(|</html>|) 

Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT) 



memo.Form = "Memo"

memo.Subject = "test message"

memo.From = "webmanager@salvationarmy.org.uk"

memo.ReplyTo = "webmanager@salvationarmy.org.uk"

memo.InetFrom = "webmanager@salvationarmy.org.uk"

memo.Principal = "webmanager@salvationarmy.org.uk"

memo.SendTo =  "psarfaraz@hotmail.com"

s.ConvertMIME = True

Print "<p>Sending HTML memo</p>"

memo.Send(False)

End Sub

I have signed the agent by the server as well.

anyhelp would be highly appreciated.

Subject: The web server is not correctly set up to send email…

You need to consult with a server administrator. The problem is that email generated by the web server is going nowhere because the web server is not correctly set up to route the mail.