Using GMail smtp server for sending emails

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Re: Using GMail smtp server for sending emails

    ....a way to configure CF to use gmail to send out email ... Looks like SSL
    might be the problem.
    But why? Coldfusion can send out e-mail from a gmail sender with or without
    gmail, and with or without SSL.




    <cfmail to="him@hisDomain.com" from="me@gmail.com" server="127.0.0.1"
    username="myMailServer_username" password="myMailServer_password"
    subject="Gmail test" timeout="60">
    Eureka! It works!
    </cfmail>

    BKBK Guest

  2. Similar Questions and Discussions

    1. CFMAIL sending two emails
      I'm going to give these suggestions a try now. The weird thing for me is it is only sending double emails to the cc recipient. Thanks guys.
    2. Problems sending mail with Windows 2003 server's SMTP server (I'm also using the integrated POP3 service)
      Hi, I am setting up POP3 accounts for my users. I am using the POP3 and SMTP services built into Windows 2003 Server Std Edition. My users can...
    3. sending chinese character emails via Net::SMTP using Mime-tools
      Howdi, I want to send chinese character emails via Net::SMTP perl. Is the most reliable format MIME encoding? If so, and I have a stream of...
    4. sending form data as email using SMTP server ???
      How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is...
    5. Sending message to SMTP server using CDONTS component
      I recently set up a web site which I am running locally on my laptop using ASP.Net. From a web form on the site I am attempting to send an email...
  3. #2

    Default Re: Using GMail smtp server for sending emails

    Gmail has an SPF record associated with it, so don't expect sending emails out
    from a gmail address using a non-gmail SMTP server to work for long. More and
    more mail servers are checking SPF records and using that to filter spam.

    Kronin555 Guest

  4. #3

    Default Re: Using GMail smtp server for sending emails

    Kronin555,
    The mail server I'm running alongside Coldfusion is
    [url]http://www.jscape.com/articles/sending_email_smtp_ssl_gmail.html[/url].
    It is in Java. However, I've converted it into Coldfusion for you.

    Prerequisites

    1. Create the new folder secure_inet in C:\CFusionMX7\Mail;
    2. On the jscape.com page above, click on the link to
    download "Secure iNet Factory";
    3. Enter your e-mail address and agree to the terms;
    4. Download setup.exe ;
    5. Launch the setup executable and choose to extract to the directory
    C:\CFusionMX7\Mail\secure_inet . This ensures that the key JAR file,
    sinetfactory.Jar will be stored as
    C:\CFusionMX7\Mail\secure_inet\lib\sinetfactory.Ja r;
    6. In the Coldfusion Administrator, add this to the JVM classpath:
    C:\CFusionMX7\Mail\secure_inet\lib\sinetfactory.Ja r
    7. Restart the Coldfusion MX server service.
    8. Run the coldfusion script. It should go like an intercity train.





    <cfscript>
    // create new instance
    SSL_SMTP_obj =
    CreateObject("java","com.jscape.inet.smtpssl.SmtpS sl").init("smtp.gmail.com",465
    );
    // address the message
    email_message =CreateObject("java","com.jscape.inet.email.EmailM essage");
    email_message.setTo("me_myself@testDomain.com");
    email_message.setFrom("myGmailUsername@gmail.com") ;
    email_message.setSubject("This time it's for real.");
    email_message.setBody("Test succeeded. Eureka!");
    // connect, send the message, disconnect
    try
    {
    SSL_SMTP_obj.connect();
    SSL_SMTP_obj.login("myGmailUsername","myGmailPassw ord");
    SSL_SMTP_obj.send(email_message);
    SSL_SMTP_obj.disconnect();
    }
    catch(Exception e)
    {
    WriteOutput(e);
    }
    </cfscript>

    BKBK Guest

  5. #4

    Default Re: Using GMail smtp server for sending emails

    " Kronin555,
    The mail server I'm running alongside Coldfusion is hMailServer 4.1, which
    supports the Sender Policy Framework(SPF). I wonder if that is sufficient."

    Nope. SPF has nothing to do with the specific capabilities of the sendmail
    server involved, it has everything to do with locking down which mail servers
    can send out mail "from:" a domain. (it's more complicated, because it actually
    checks the envelope sender, which is the return-path in the email, but
    Coldfusion sets the envelope sender to either the from: address, or the failto:
    address).

    [url]http://spf.pobox.com/[/url]

    Gmail.com's SPF record is as follows (note it contains a ?all, which is
    basically a wildcard for any other SMTP server, my guess is that will be
    removed in the future which is when things would break. Until then, you could
    successfully do what you originally proposed, but you're just asking for it to
    break later):

    v=spf1 a:mproxy.gmail.com a:rproxy.gmail.com a:wproxy.gmail.com
    a:zproxy.gmail.com a:nproxy.gmail.com a:xproxy.gmail.com a:qproxy.gmail.com ?all

    Kronin555 Guest

  6. #5

    Default Re: Using GMail smtp server for sending emails

    >> I wonder if that is sufficient.
    > Nope. SPF has nothing to do with the specific capabilities of the sendmail
    server involved

    Thanks Kronin555,
    Until yesterday, I had only a passing acquaintance with SPF. Anti-spam,
    anti-phishing and
    all that. I've had a read, and now fully understand everything you've said.
    Strictly speaking,
    Kraminator's search is purely an academic exercise. In spamming!

    SPF technology is fascinating. Knowing what I now know, I'm going to turn
    half-circle.
    I've begun studying ways to use SPF to protect our e-mail from programmers
    like me.

    BKBK Guest

  7. #6

    Default Re: Using GMail smtp server for sending emails

    "Does this access enable the inclusion of Gmail's SPF data?"

    No. Emails themselves don't "include" SPF data. When an SPF-aware email server
    receives an email, it does a DNS lookup on the domain of the envelope sender,
    looking for an SPF record. If it finds one, then it checks the SMTP server the
    email message originated from against the allowed SMTP servers listed in the
    SPF record.

    That said, the method you outlined uses one of the authorized gmail SMTP
    servers to send the email, so emails sent using this method will pass any SPF
    checks.

    Kronin555 Guest

  8. #7

    Default Re: Using GMail smtp server for sending emails

    When an SPF-aware email server receives an email, it does a DNS lookup on
    the domain of the envelope sender, looking for an SPF record.
    Indeed. Thanks. Just read about the mechanics of the process a moment ago.

    That said, the method you outlined uses one of the authorized gmail SMTP
    servers to send the email, so emails sent using this method will pass any SPF
    checks.
    Well, Kraminator, you heard what the man said. Go on, set it on 10.



    BKBK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139