The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by jefflehmann]

Using JBuilder, I compiled correctly the applet, deployed it on a form and was
able to display the applet fine in a browser. The clear button works but the
send button is not sending an e-mail. What should I change?

Here is the code:
import lotus.domino.*;
import java.applet.*;
import java.awt.*;
public class SendemailappletJDK extends AppletBase {
Document memo;
Database db;
java.awt.TextField txtStatus = new java.awt.TextField("",60);
java.awt.TextField txtSendTo = new java.awt.TextField("",30);
java.awt.TextField txtSubject = new java.awt.TextField("",30);
TextArea txtBody = new TextArea("",1,30);
Button btnSend = new Button("Send");
Button btnClear = new Button("Clear");
Label lblSendTo = new Label("Send To:");
Label lblSubject = new Label("Subject:");
Label lblBody = new Label("Body:");
public void notesAppletInit() {
super.notesAppletInit();
setLayout(new FlowLayout());
setSize(300,300);
add(txtStatus);
add(lblSendTo);
add(txtSendTo);
add(lblSubject);
add(txtSubject);
add(lblBody);
add(txtBody);
add(btnSend);
add(btnClear);
try {
Session s = this.getSession();
db = s.getDatabase("","names.nsf");
} catch (NotesException n) {
System.out.println("Error#" + n.id + " (" + n.text + ") ");
} catch (Exception e) {
e.printStackTrace(); } }
public boolean action(Event evt, Object arg) {
if (evt.target.equals(btnSend)) {
try {
memo = db.createDocument();
memo.replaceItemValue("Form","Memo");
String sendTo = new String(txtSendTo.getText());
String subject = new String(txtSubject.getText());
String body = new String(txtBody.getText());
memo.replaceItemValue("Subject",subject);
memo.replaceItemValue("Body",body);
memo.send(sendTo);
txtStatus.setText("Message sent.");
} catch (NotesException n) {
System.out.println("Error#" + n.id + " (" + n.text + ") "); }
} else if (evt.target.equals(btnClear)) {
txtStatus.setText("");
txtSubject.setText("");
txtSendTo.setText("");
txtBody.setText(""); }
return(true); } }
import-bot (20211) [Avatar] Offline
#2
Re: No mail sent for Applet for example 23.4
[Originally posted by aspatton]

Are you receiving any error messages? Anything on the Domino server console?

Tony.
import-bot (20211) [Avatar] Offline
#3
Re: No mail sent for Applet for example 23.4
[Originally posted by jefflehmann]

Thanks, Tony for your response.

I am not receiving any error messages nor am I seeing anything on the Domino
server console. The clear button works, but the send button does not.

> Are you receiving any error messages? Anything on the Domino server console?
>
> Tony.