Configure ReplyTo to SendEmail

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
lfernandes
User
Posts: 82

Configure ReplyTo to SendEmail

Post 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

lfernandes
User
Posts: 82

Post by lfernandes »

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


MichaelG
User
Posts: 1192

Post by MichaelG »

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


lfernandes
User
Posts: 82

Post 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


MichaelG
User
Posts: 1192

Post by MichaelG »

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


Post Reply