Force cfmail tag to send from a specfic server IP address

耗尽温柔 提交于 2019-12-11 05:46:08

问题


Here is my server set up:

  • Web Server: ColdFusion 10 u10 64-bit, Windows Server 2008 R2, multiple public/private IP addresses.
  • Mail server: Is a different Windows 2008 R2 server.

Keeping it simple for this question, I have two web sites (this is just theory; using private IPs in example).

  • Site 1: 10.10.10.1
  • Site 2: 10.10.10.2

I'm sending mail using the cfmail tag from Site 1 (10.10.10.1), but when I look at the mail headers of the sent emails and the SMTP log on the mail server, it says that the mail was sent from Site 2 (10.10.10.2).

I did some google searches regarding this issue and came up with this bugbase report. The bug doesn't appear to have been fixed. However, I was wondering if there were any work-arounds. I want the mail that is sent from "Site 1" to have that sites IP address in the email header.


回答1:


Have you tried specifing the mailserver similar to the below?

 <cfmail 
to="<<<email>>>"
from="<<<fromEmail>>>"
subject="Some Subject"
type="html"
server="server to send from (ip)" 
port="port for mail server">
        body=" <<<content here>>>"

By default Coldfusion will use the email server configured in the admin console. By defining mail servers in the cfmail tag this should be overwritten.



来源:https://stackoverflow.com/questions/16931081/force-cfmail-tag-to-send-from-a-specfic-server-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!