Coldfusion CFMAIL and sendgrid

前端 未结 2 793
醉梦人生
醉梦人生 2021-01-19 03:10

I have 2 clients on the same server that I host, that both send email through sendgrid.com (both have their own accounts).

I was looking at reports on sendgrid and n

2条回答
  •  伪装坚强ぢ
    2021-01-19 03:40

    I don't know what version of ColdFusion you are running but in ColdFusion 9 a new feature was added that allows you to specify the SMTP server settings in your Application.cfc file. Assuming that you have separate Application.cfc files for your 2 sites then perhaps this will work for you.

    Here is a reference to the new feature in ColdFusion 9

    Here is the text from that referenced page.

    Problem
    How can I use the different SMTP Server Settings for Applications hosted in ColdFusion server for sending Email.

    Solution
    By using the new ColdFusion 9 “smtpServersettings" feature in Application.cfc file, we can specify different SMTP server settings for Applications.

    Detailed explanation
    ColdFusion 9 added a new attribute called "smtpServersettings" to the Application.cfc file. We can specify the SMTP server setting details to "smtpServersettings" attribute of THIS scope in Application.cfc which takes three values and they are server, username and password as a structure.

    
    
       
       
    
    

    Now the CFMail tag will use the server details for sending mails as mentioned above in "smtpServersetting" in Application.cfc and it won't use the server values specified in the ColdFusion 9 Administrator. If "smtpServersetting" attribute is not used then CFMail will behave as normally.

提交回复
热议问题