- public void signAndSend(long secret) throws IOException, Message.Malformed {
- SMTP.Outgoing.accept(new Message(new Stream("From: " + FROM + "\r\n" +
- "To: " + who.toString(true) + "\r\n" +
- "Subject: confirm " + getDescription() + "\r\n" +
- "\r\n" +
- "Please click the link below to " + getDescription() + "\r\n" +
- sign(secret)),
- new Message.Envelope(FROM, who, new Date())
- )
- );
+ public void signAndSend(Address sender, long secret, Date now) throws IOException, Message.Malformed {
+
+ Headers h = new Headers(new String[] {
+ "From", sender.toString(true),
+ "To", who.toString(true),
+ "Message-Id", Message.generateFreshMessageId(),
+ "Date", new Date()+"" /*FIXME!!!*/,
+ "Subject", "confirm " + getDescription()
+ });
+
+ Fountain fountain = Fountain.Util.create("Please click the link below to " +
+ getDescription() + "\r\n" +
+ getURL(sign(secret)));
+ Message m = Message.newMessageFromHeadersAndBody(h, fountain, sender, who);
+ SMTP.Outgoing.enqueue(m);