submit to email

amd1979
amd1979 used Ask the Experts™
on
Expert,
i have a form that accessible on web, where the user can submit there email add, subject and there comments etc.,
My problem i want to create a Submit button, and when i click that button the message will forward to a certain EmailAdd.
AMD

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Have a save options field with value 1, and a sendTo field with value of the email ID.

A simple save will email the document to the email id.

Or you must run a webquerysave agent with the emailing code.

-Arun.

Author

Commented:
Im new with R5,
Pls give me more detail.

my form is compose of

EmailADD: "field"

Subjects: "field"

Comments: Richtextbox
and

Submit Button

This is form can be access by anyone.
my email is exchange not lotus notes mail..


thanks.
amd

Commented:
ok, then the only thing you have to do, is to add to your form 2 fields:
SaveOptions: text-field - Computed when composed - value="1";
SendTo: txet-Field - computed when composed - value="webmaster@mydomain.com" (or whatever email address you want.)
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Commented:
Just another question: when you say "my email is exchange not lotus", do you mean that you messaging system is exchange or that your e-mail account is managed with exchange?
I the first you can configure your domino to "forward" emails to your exchange server by defining a "Foreign smtp domain" and a connexion document of type "smtp" then you indicate the exchange server host name.
I the second, you have nothing to do

Author

Commented:
i create a field
SendTo  value "myemail@domainname" with quote
SaveOption  vaue "1" with quote

but when i click the button Submit with formula @command([Filesave]) the link is dead it should be "Form Process" im ryt?

excess:
Regarding on the Exchange matter it does mean any sence i only said that the message in this form will be forwarded to Exchange mail,  or any domain such as @hotmail or @yahoo.







Commented:
ok, then create a shared agent in which you can paste this code:

in the initialize event:
Sub Initialize
Dim CurrentSession as New NotesSession
Dim CurrentDoc as NotesDocument

Set CurrentDoc=CurrentSession.CurrentDocument
Call CurrentDoc.Send(False)
End sub

The agent should be set to run "Manually from Agent List" and "Run once".
Name this agent "(SendMyMail)" forexample

Then in your form, in the (WebQuerySave) event, add the following:
@Command([ToolsRunMacro]; "(WebQuerySave)")

that's it....

PS: keep your field SendTo and SaveOptions...There are needed.

Author

Commented:
i cant save the agent

there was an error in code pls check,


excess: the value of Sendto an saveoptions remain?


thanks ariel
Yes the value of the sendTo should stay right there.

Author

Commented:
i cant save this agent

Dim CurrentSession as New NotesSession
Dim CurrentDoc as NotesDocument

Set CurrentDoc=CurrentSession.CurrentDocument
Call CurrentDoc.Send(False)
End sub

what is wrong with this?

Author

Commented:
i forgot to include sub initialize
:-) there you go !

Commented:
remember that it should be a LotusScript agent!  ;-)
amd figured it out him/her self !!!

:-)

Author

Commented:
YES I INCLUDE THAT ON LOTUS SCRIPT BUT NO SUCCESS IN SAVING

red font on this section "Set CurrentDoc=CurrentSession.CurrentDocument"

what do you think?
make the line as

set currentdoc = currentsession.DocumentContext

-Arun.

Commented:
Sorry, replace tyhat line by the following:
Set CurrentDoc=CurrentSession.DocumentContext
Oops!  Late by one minute buddy!  I got that first...

*Smile*

This is getting interesting between us ain't ?

Commented:
yea man!!!! I recognize you Lucky Luck...shooting faster that your shadow!! ;-)

Author

Commented:
:( but no success, sorry to disappoint you, what do you this is my mistake?

Author

Commented:
:( but no success shen i click the submit button the link is dead., sorry to disappoint you, what do you this is my mistake?
No success in saving or executing ?
Well your tools run macro reads

@Command([ToolsRunMacro]; "(WebQuerySave)")

It should actually read the following,

@Command([ToolsRunMacro]; "(SendMyMail)")

:-)
Arun.

Hi Abdel!!!!!!!!!!!!!!!!!!!!!

Author

Commented:
the link is dead.. :( :( :(
i try both.

Commented:
bravo Arun.....   I better go home and have a good sleep... I'm a bit tired....   Sorry amd, I forget to change the value after having paste the code....

Commented:
How did you named your agent?
Did you create you agent as shared?
I think this has something to do with restrictions on agents. What do you think Abdel ?

Author

Commented:
Agent name = SendMyMail
i check the shared agent.

i think there is something wrong with the foerm not in agent.

Author

Commented:
This site is the great example of what im trying to do.

http://www.flextronics.com/contactus/default.asp

Commented:
I guess yes Arun....
amd!

Can you sign this agent with some other ID that has higher access on server ?  May be an admin id ?  

Signing process is simple, use that ID to save the agent thats all.

-Arun.

Commented:
or ask your administrator to sign it for you with the server ID..He should understand what you are talking about...

Author

Commented:
im the administrator and im using the administrator id. :)

what im very new with this stuff.


Application Engineer
Commented:
Actually if you're using notes to send mail it's very easy:
Create an agent with only the following code:
Sub Initialize
    Dim session as New NotesSession
    Dim doc as NotesDocument
    Set doc=session.DocumentContext
    call doc.Send(True, "mailadress@email.com")
End Sub

However if you're not using notes for mail, I can't think of a way to send the mail, using exchange.
You would need to build your application on an IIS server and use asp script for example.

The site you mention above does just that.

Regards,
JM
Jean Marie GeeraertsApplication Engineer

Commented:
Wow, I totally forgot about this one :-)
Thanks for the A...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial