3 Replies Latest reply on Mar 30, 2011 4:42 AM by 839870

    Issues in sending e-mail from FDM

    839870
      Hi Experts,
      I am working on FDM v 11.1.1.3, windows 2003 SP2, IIS 6.0 and I am trying to send an e-mail using the Send Mail accelerator and following is the code:

      'Define variables etc.

      strFromAddress = DW.Security.fUserEmailGet(DW.Connection.PstrUserID)

      strToAddress = "xyz@gmail.com" '"YourToAddress"
      strSubject = "Import Failed" '"YourSubjectLine"
      strEmailMsgLine = "The import process has failed." '"YourMessageLine"

      strSMTPServer = "smtp.gmail.com"
      'CdoSendUsing enumeration-1=use smtp on local machine, 2=use smtp over network
      intSendUsing = 1
      'SMTP port on server
      intSMTPPort = 25

      Set objConfig = CreateObject("CDO.Configuration")     
      With objConfig.Fields
           .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = intSendUsing
           .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
           .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")= intSMTPPort
           .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
           .Update
      End With

      'Create CDO message object
      Set objMsg = CreateObject("CDO.Message")     
      'Assign config object to configuration property of message object
      Set objMsg.Configuration = objConfig
      'Set Message object settings and send mail
      With objMsg
           .To = strToAddress
           .From = strFromAddress
           .Subject = strSubject
           .TextBody = strEmailMsgLine
           .Send
      End With

      'Destroy message objects
      Set objMsg = Nothing
      Set objConfig = Nothing

      When I set 'CdoSendUsing' to 1, an eml file gets generated on the path 'C:\Inetpub\mailroot\Pickup' but I never receive it on my gmail ID. When I set the 'CdoSendUsing' to 2, I get an error on the .Send line saying 'The server rejected the sender address. Server response was 530 5.7.0 must issue a STARTTLS command first'. I also checked the MetaBase.XML, 'PickupDirectory' is set.

      Please suggest where am I going wrong.

      Thanks & Regards!
        • 1. Re: Issues in sending e-mail from FDM
          TonyScalese
          You can't use google's smtp server to send emails as far as I know. If you could, imagine all of the hijacks that server would face.

          If trying to send using the local server, you must enable the FDM server to also function as an SMTP server. Google enabling SMTP on Windows Server 2003 and you'll find some articles on how to set it up.
          1 person found this helpful
          • 2. Re: Issues in sending e-mail from FDM
            beyerch2
            Just to confirm what Tony is saying :

            - It's highly unlikely that Google functions as a Mail Relay for SMTP. If it did spammers would have a field day. An open relay is a mail server that will forward emails sent to it from unknown 3rd parties. I'm not familiar with your Google service; however, if they allow any type of mail relaying form you, it is probably secure with at least a login and password so they know it is coming from you. (This would mean when you use the CDONTS object, you'll need to supply a sender login and password)

            - The reason why files are accumulating in the Pickup folder is you do not have a running SMTP service that is processing emails on the server that you pointed FDM to. For reference, the following folders are used by your typical SMTP mail service :
            * Pickup : Email files waiting to be picked up by the SMTP server for processing (if you open the EML file in a text editor, should be apparent what it is) If the email is meant for an external party, it will be sent to their mail server. If the message is meant for an internal user, gets moved to Drop folder.
            * Drop : Incoming messages for local users are stored here
            * Queue : Messages that were sent but could not be immediately delivered are placed here. These will be resent at various intervals for a predetermined amount of attempts.
            * Badmail : Messages that could not be delivered. Viewing in a text editor should indicate the failure, etc. Senders are not notified of these failures in most cases unless an Admin notifies them based on what is in this folder.

            The easiest option here is to install SMTP on the FDM box and call it a day.
            * MS Install Instructions for Server 2003 - http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true

            * MS Configuration information for SMTP on IIS 6.0
            http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true

            One NOTE :

            - If your company has a mailserver (who doesn't?? :) ), the MX record will be linked to the IP of that machine and not your SMTP box. Certain anti-spam solutions as well as other mail servers might reject your emails as when they perform a reverse lookup, the IP address of your SMTP server will not match that of your MX entry (DNS).

            If this happens, you should configure your FDM SMTP server to send its mail to your local mail server and talk to your IT department to make sure all necessary changes are in place. (i.e. you might need to configure Exchange to let your FDM SMTP use it as a mail relay, etc)
            1 person found this helpful
            • 3. Re: Issues in sending e-mail from FDM
              839870
              Thanks a loads for the detailed explanation! The reason why I thought of using google's SMTP server was that I was working remotely on the demo drive and the only option to test this at that point in time was by giving it a shot with google.

              The next day I tried using the box on which the company's SMTP server is installed with the server name but the code throws an error on the '.Send' line saying that 'trouble connecting to the server'.
              Getting in touch with the IT revealed that there is some issue with the IP address to server name mapping and/or a firewall issue. Looks like that is what you pointed out in your reply. If they can't resolve it, I will look forward towards configuring FDM SMTP server.

              Really appreciate your as well as Tony's guidance on this!

              Thanks & Regards!