Skip to main content
Known Participant
November 10, 2010
Question

CFMail Bug?

  • November 10, 2010
  • 1 reply
  • 1031 views

The smtp username is overiding the from field so every email received will have the smtp username as the sender. What am I doing wrong?

<cfmail
    to        = "youremail@yahoo.com"
    from     = "sender123@gmail.com"
    subject  = "This is a Test"
    server   = "smtp.gmail.com"
    username = "gmailaccount@gmail.com"
    password = "passwordhere"
    port     = "465"
    useSSL   = "true">
   
     The from address of this email should show "sender123@gmail.com".
    However it shows "gmailaccount@gmail.com" which is the smtp username.

    Is this is a bug?
   
</cfmail>

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    November 10, 2010

    Before one cries BUG, one should verify where the change is happening.

    I've done tasks nearly exactly like you are trying with local mail systems with no problem.

    I would look into the ColdFusion mail logs (you may need to turn on FULL logging in the Administrator).

    See what those messages look like.

    There is a possibility this is something Google is doing.  They may not want people to use different FROM address from the account logged into the gmail server.

    LionelR1Author
    Known Participant
    November 10, 2010

    I did not "cry" bug, I simply asked if this was a bug.

    Did you try testing with with gmails smtp server and using a different "from" address then your smtp?

    I am able to succesfully use yahoo POP to receive my mail and gmail's SMTP to send my mail using thunderbird, however CFMail is just overiding the from field with the smtp username.

    November 10, 2010

    I have no problem using setting the from address using a private smtp server, so I think the chance of it being a bug super small.

    I think you will find gmails smtp servers will not allow you to changes the senders email address.  Otherwise it would be abused by spammers alot.

    You mentioned being able to send email using thunderbird, can you successfully override the sender address that way?

    Cheers