Page 1 of 1

Configure ReplyTo to SendEmail

Posted: Mon Jun 10, 2024 5:27 pm
by lfernandes

I made the following changes to the aspnetfn.as file in order to configure replyto

public static async Task<bool> SendEmailAsync(string from, string to, string cc, string bcc, string replyTo, string subject, string body, string format, string charset, SecureSocketOptions options, List<Dictionary<string, string>>? attachments = null, List<string>? images = null, SmtpClient? smtp = null)

....

    if (!Empty(replyTo))
        mail.ReplyTo.Add(ConvertToMailAddress(replyTo));
    mail.Subject = subject;

When compiling the project the following error occurs:

SyntaxError: Unexpected token ';' while compiling ejs
    at new Function (<anonymous>)
    at C.compile (C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:8:184997)
    at e.compile (C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:8:182839)
    at C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:9:124421
    at Array.forEach (<anonymous>)
    at global.CompileTemplate (C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:9:124011)
    at main (C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:9:138487)
    at Object.<anonymous> (C:\Users\lffer\AppData\Roaming\ASPNETMaker2023\node_modules\@aspnetmaker\core\aspnetmaker.js:9:138882)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
Node.js v20.11.0

Re: Configure replyTo to SendEmail

Posted: Wed Jun 12, 2024 9:39 pm
by lfernandes

I need help to configure the response email using the MimeMessage.ReplyTo Property. Does anyone have an idea of ​​how to solve?


Re: Configure replyTo to SendEmail

Posted: Thu Jun 13, 2024 5:45 am
by MichaelG

You'd better open your project in Visual Studio, make your changes first, make sure that it works before modifying the template.


Re: Configure replyTo to SendEmail

Posted: Thu Jun 13, 2024 8:38 pm
by lfernandes

I made the changes and worked well, however when I apply the change in the model occurs the error mentioned above. I need that whenever I generate a project by Aspnetmaker this change is considered


Re: Configure ReplyTo to SendEmail

Posted: Fri Jun 14, 2024 6:32 am
by MichaelG

Show your changes and explain how you modify the template. Also read Customizing Template.