@MailSend on the web - URGENT

That worked. But I am actually trying to retrieve fields from the current form and send out emails. The code is as follows:

Dim session As New NotesSession

Dim maildb As New NotesDatabase( “”, “” )

Dim doc As NotesDocument

Dim maildoc As NotesDocument

Dim DocNum As Variant

Dim AM As Variant

Set doc = session.DocumentContext

DocNum = doc.GetItemValue(“DocNum”)

AM = doc.GetItemValue(“AMgr_1”)

Call maildb.Open( “Domino3/Interactive/West”, “mail\internet.nsf” )

Set maildoc = New NotesDocument( maildb )

maildoc.Form = “Memo”

maildoc.Subject = “Test”

maildoc.Body = " This is an automated reminder for sdr."

maildoc.SendTo = “Priya S Srinivasan”

maildoc.CopyTo = “Rhonda M Petersen”

Call maildoc.Send(False)

I get the following error:

Agent ‘Submit SDR’ error: Notes error: You do not have a mail file/server specified. Use File Mobile Edit Current Location… to set them.

Subject: @MailSend on the web - URGENT

You don’t need to save a document in a mailbox to send a message. The current database is fine. Whowever signs the agent must have their email configured properly.

Set db = s.Currentdatabase

Set doc = s.Documentcontext

Set memo = db.Createdocument()

Set rtitem = memo.CreateRichTextItem( “Body” )

Call rtitem.Appendtext("Name: " & doc.txtForenames(0) & " " & doc.txtSurname(0) )

Call rtitem.Addnewline(1)

’ write more

memo.subject = “thanks for submission”

memo.replyto = “helpdesk@company.org

If ( doc.EmailAddress(0) <> “” ) Then

memo.SendTo = “helpdesk@company.org

memo.ReplyTo = doc.EmailAddress(0)

Call memo.Send( False )

'memo.SendTo = doc.EmailAddress(0) ’ send copy to email on the form

'memo.ReplyTo = “helpdesk@company.org

'Call memo.Send( False )

Else

memo.SendTo = “helpdesk@company.org

memo.ReplyTo = “helpdesk@company.org

Call memo.Send( False )

End If

Subject: @MailSend on the web - URGENT

I guess this posting is out oif its original thread.

But my advise is: read the Agent FAQ.

Subject: @MailSend on the web - URGENT

You’ve a big mistake, you can use the maildocsent. THe best way is you create a document in the database “Mail.box” and when you save the document with this fields"From",“sendto”,“recipients”,“copyTO”,“BlindCopy”,“Subject”,“Body”,“posteddate” you only save the document and you can send.

THe only problem you will have if you’ve more mailboxes and you need this programm I designed.

================================================

level=0

While (dbenv Is Nothing) And (i<10) And (level<1)

	Set dbenv=New Notesdatabase(db.server,"mail"+Trim(i)+".box")

	If Not (dbenv Is Nothing) Then level=dbenv.Currentaccesslevel

	i=i+1

Wend

Print "PASA POr aquí"

If (dbenv Is Nothing) Then 

	Print "Entra a dbenv session"

	Set dbenv=session.getdatabase(db.server,"mail.box")

End If

If (dbenv.Currentaccesslevel<1) Then

	Set dbenv=session.getdatabase(db.server,"mail.box")

End If

Print "ANTES DE ABRIR"

Set doc=dbenv.createdocument

==============================================

This programm watch which mailbox can use, I put a limit to 10 mailboxes. It’s unsuall than company has more 10 mailboxes.

I’m hoping to help you, if you have some doubt, please send me an Email. My Email is roger_fa@hotmail.com