Closed RenanSanguinete closed 3 years ago
Based on solution on that issue https://github.com/shihabmridha/react-native-smtp/issues/3 I was able to solve it here.
If anyone is interesting on Android I change the RNSmtpMailerModule.java adding:
On sendEmail function add String replyTo = obj.getString("replyTo");
run function modify sender.sendMail(subject, body, from, recipients, bcc, attachmentPaths, attachmentNames, attachmentTypes, replyTo);
on MailSernder class
public synchronized void sendMail(String subject, String body, String sender, String recipients, ReadableArray bcc, ReadableArray attachmentPaths, ReadableArray attachmentNames, ReadableArray attachmentTypes, String replyTo) throws Exception { ....... message.setReplyTo(InternetAddress.parse(replyTo)); ...... }
iOS I change the RNSmtpMailer.m adding:
on sendMail method ... NSString replyToEmail = [RCTConvert NSString:obj[@"replyTo"]]; ... MCOAddress replyTo = [MCOAddress addressWithDisplayName:nil mailbox:replyToEmail]; ... [[builder header] setReplyTo:@[replyTo]]; ...
@RenanSanguinete Thanks a lot for the provided solution. I intent to release a new version on the weekend, including this enhancement, TS support, #20 & #10 additions, and also to remove the necessity to provide all arguments, as more of them can be optional. If you wish to PR your solution till then, you're more than welcome!
I see that PR #20 and after implement wasn't what I expected, so I implement myself base of the solution posted. I split the username from the user that is the key to login. So that way it's two separated information, that's the best for my case.
@angelos3alex I tried to PR my modifications, but I get the 403 error on final step, git push. So I can copy and paste here both files if u want to check and merge after.
You can fork this repo, then push your solution to your repo, and then PR it to this repo
Someone knows if is possible to use reply-to?
I need to somehow specify other email to reply insted the email indicated on to field.