我使用sendgrid发送电子邮件,使用以下代码工作正常
但它没有附件.
package sendgrid;
import com.sendgrid.Content;
import com.sendgrid.Email;
import com.sendgrid.Mail;
import com.sendgrid.Method;
import com.sendgrid.Request;
import com.sendgrid.Response;
import com.sendgrid.SendGrid;
import java.io.IOException;
public class SendEmail {
public static void main(String[] args) throws IOException {
Email from = new Email("test@example.com");
String subject = "Hello World from the SendGrid Java Library!";
Email to = new Email("shareef@gmail.com");
Content content = new Content("text/plain", "Hello, Email!");
Mail mail = new Mail(from, subject, to, content);
SendGrid sg = new SendGrid("SG.rIEh84OgQBybYEJcOMie1wd.AZqqdWNYXbOqTarUJcG-iSg0Ut