Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplyTo #188

Closed
mohamad-elbohsaly opened this issue Aug 14, 2021 · 1 comment
Closed

ReplyTo #188

mohamad-elbohsaly opened this issue Aug 14, 2021 · 1 comment

Comments

@mohamad-elbohsaly
Copy link

Let's say I send a message from the company email to a recipient1 CCing another recipient2. Can I do a replyTo: recipient2?

@close2
Copy link
Collaborator

close2 commented Aug 15, 2021

You can add your custom headers:

  final equivalentMessage = Message()
    ..from = Address(username, 'Your name 😀')
    ..recipients.add(Address('destination@example.com'))
    ..ccRecipients.addAll([Address('destCc1@example.com'), 'destCc2@example.com'])
    ..bccRecipients.add('bccAddress@example.com')
    ..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:myimg@3.141"/>'
    ..headers = { 'Reply-To', Address('recipient2@example.com', "Rec 2") }
    ..attachments = [
      FileAttachment(File('exploits_of_a_mom.png'))
        ..location = Location.inline
        ..cid = '<myimg@3.141>'
    ];

I have added a headers line to the example code above:
..headers = { 'Reply-To', Address('recipient2@example.com', "Rec 2") }

The address in the reply-to can be any address. It's not necessary to add the reply-to address to the CC list.

@close2 close2 closed this as completed Aug 15, 2021
@close2 close2 mentioned this issue Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants