I searched and searched - now turn to you all.... need help with NotesUIDocument.Send

Goal: Application, requires an email response to be sent to customer. User will press button, creating a new uidoc with the information the customer needs. User is prompted with Contact Name and Email Address and asked if email should be sent.

Problem: No errors, nothing in log, no dead mail in mail.box on any of the servers. Email is not delivered to external address.

Document has the following fields:

SendTo (defined)

MailOptions = 1

SaveOptions = 0

Subject (defined)

Code:

Dim euidoc As NotesUIDocument	

Dim answer As Integer

Set euidoc = w.ComposeDocument( "", "", "responseToCustomerEmail" )

answer% = Messagebox("Response being emailed to... " + Chr(10) +_

"Contact = " + curdoc.custContactName(0) + Chr(10) +_

"Email Address = " + curdoc.QAresponseReference(0), 36, "Send Email?")

If answer% = 6 Then '6 = yes

	Call euidoc.Send		

	Call euidoc.Close

Else

	Call euidoc.close

End If 			

I have spent hours in trial and error - searching and trying… any help would be greatly appreciated.

Thanks

Mike

mferrari@accuride.com

Subject: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

Where is SendTo “defined”?

Subject: RE: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

Two ways… first I have it as a computed field inheriting the values off the curdoc - then reading posts (actually I think one of yours filesave, I added in a line of code that said uidoc.fieldsettext(“sendto”,curdoc.QAresponseReference(0))

m

Subject: RE: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

Run the code with the debugger on to make sure SendTo has a value…

Subject: RE: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

unfortunately I can’t do that…as the set euidoc = w.ComposeDocument won’t work in the debugger.

however,

AFTER my euidoc.FieldSetText

BEFORE my euidoc.send

I added

Messagebox(euidoc.FieldGetText(“SendTo”))

and this gives me the correct external email address.

Subject: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

Try saving instead of sending your test document. I suspect you’ll find that SendTo has a value of blank.

I’d suggest using a dialogbox for this. Include on the form you display in the dialogbox any fields you need (e.g., SendTo, Body). If user clicks OK, send the message.

Subject: RE: I searched and searched - now turn to you all… need help with NotesUIDocument.Send

Since I have the sendto populated - it shouldn’t be blank (but I will try) and the only problem with the dialogbox is that gives the ability for the user to change the destination - perhaps this is workable - just wasn’t intending to give this option.

Subject: You can use a computed field

You can use a computed SendTo field in the form you open in the dialogbox. Then the user won’t be able to edit it.