-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
mail.cfc conflicts with Adobe's CFC to send mail - "new mail()" #4
Comments
Interesting. What version of Adobe ColdFusion? And could you put together a small reproduction of the error? I'm just interested in what structure results in the conflict/confusion. |
I used the exact sample that I posted from the links. I'm using CF2016u15, but this syntax (according to CFDocs) has been around since CF9. (I initially didn't use many of the early cfscript functions as there were many bugs and not all functions were supported.) mailService = new mail(
to = "myemail@company.com",
from = "myemail@company.com",
subject = "Example email #Now()#",
body = "Example email #now()#"
);
mailService.send(); Resulted in this error:
|
Ahhh, ok. Maybe this is because you're using it as a Custom Tag? I typically include this It's my understanding that the "Script functions implemented as CFCs" was a bit of a hack on the part of Adobe for ColdFusion 11 I think. The advice I recall (though I'd need to track its source down), is that the scripts-as-cfcs are a bit buggy and more trouble than they're worth. I'm fairly sure that Adobe has since added actual full script support, so you can just use I know this doesn't entirely resolve you're issue, but does it help/address it at all? |
Sorry, yes... SendGrid is in the shared CustomTags path. After encountering the error, I upgraded to the CF11+ cfmail() built-in function (versus the CFC hack). I noticed that Adobe provides little documentation regarding the syntax, but it is similar to the tag. The best guide I could find was from LearnCFInAWeek > Mail. (I like to specify both text & HTML message bodies.) This may not be an issue at all, but could cause problems for CF9 & 10 users that use the same CustomTags approach. Thanks for the quick response! |
Glad that worked out. I can add a note to the README, regarding CustomTags and older versions of Coldfusion. Do you think that would be worthwhile? |
I've got
|
I updated a regular tag-based CFMail to use cfscript and ran into an issue where instead of accessing the built-in function, it used the
sendgrid/helpers/mail.cfc
library instead.Here's Adobe's sample CFML code on how to implement CFMail as a CFC.
https://helpx.adobe.com/coldfusion/cfml-reference/script-functions-implemented-as-cfcs/mail.html
CFDocs has a similar code sample:
https://cfdocs.org/cfmail
The text was updated successfully, but these errors were encountered: