Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在邮件JAVA中发送签名_Java_Gwt - Fatal编程技术网

在邮件JAVA中发送签名

在邮件JAVA中发送签名,java,gwt,Java,Gwt,我使用Google Oauth身份验证和令牌在GWT中发送邮件。 我的项目使用谷歌OAuthAuthentication。 邮件已成功发送。我只想在发送邮件时,像在邮件中那样自动添加签名 我可以发送邮件: SMTPTransport transport = connectToSmtp(from, token); Message msg = new MimeMessage(session); msg.addRecipient(Message.RecipientType.TO,new Interne

我使用Google Oauth身份验证和令牌在GWT中发送邮件。 我的项目使用谷歌OAuthAuthentication。 邮件已成功发送。我只想在发送邮件时,像在邮件中那样自动添加签名

我可以发送邮件:

SMTPTransport transport = connectToSmtp(from, token);
Message msg = new MimeMessage(session);
msg.addRecipient(Message.RecipientType.TO,new InternetAddress(toMail));
msg.addRecipients(Message.RecipientType.CC, InternetAddress.parse(ccMail));
msg.setFrom(new InternetAddress(from));
msg.setSubject("Imprest Report");
msg.setContent(messageBody ,"text/html; charset=utf-8");
transport.sendMessage(msg,msg.getAllRecipients());

您必须添加签名作为内容的一部分,因为我认为电子邮件API不支持签名作为一个概念

我使用的代码有问题。.签名是在我们发送邮件时自动发送的…但这里不是。我不想硬编码。我想如果其他用户想要发送邮件,它应该自动使用该用户的签名。明白,但问题是没有默认的签名支持。您不必硬编码,在应用程序层中处理它,在应用程序层中,您可以为应用程序用户提供保存其签名的能力,您可以将其保存到DB表中,执行DB查找并作为内容的一部分附加。希望有帮助