如何通过邮件中的邮件发送文件附件
您好,我试图使用Mailer Flutter发送带有附件的电子邮件,因此II指定了文件路径,但是当发送电子邮件时,我只找到没有附件的文本,什么错了? 。这是代码:
final equivalentMessage = Message()
..from = Address(username, '***** ')
..recipients.add(Address('********'))
//..ccRecipients.addAll([Address('[email protected]'), '[email protected]'])
//..bccRecipients.add('[email protected]')
..subject = 'Test Dart Mailer library ::
hello i'm trying to send email with attachment using mailer flutter so i i specified the file path but when the email is sent i find just the text without the attachment what is wrong ? . this the code :
final equivalentMessage = Message()
..from = Address(username, '***** ')
..recipients.add(Address('********'))
//..ccRecipients.addAll([Address('[email protected]'), '[email protected]'])
//..bccRecipients.add('[email protected]')
..subject = 'Test Dart Mailer library :: ???? :: ${DateTime.now()}'
..text = 'This is the plain text.\nThis is line 2 of the text part.'
..html =
'<h1>Test</h1>\n<p>Hey! Here is some HTML content</p><img src="cid:[email protected]"/>'
..attachments = [
FileAttachment(File('/path/hello.txt'))
];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论