Search The ForumSearch   RegisterRegister  LoginLogin

MailBee SMTP

 AfterLogic Forum : MailBee SMTP
Subject Topic: Attachment Question Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Guests
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 02 June 2005 at 1:50pm | IP Logged Quote Guests

I'm writing an application that takes records from a database and sends out emails (with attachments) based on selected records from this database. The majority of Mailer.Message.'things' are coming from predefined application variables or from data elements within the database. I'm having difficulty taking a field item from the database and adding the item as an attachment (the field contains file names).

Code:
        oMailer.Message.FromAddr = PPSFrom
        oMailer.Message.ToAddr = PPSTo
        oMailer.Message.Subject = PPSSubject
        oMailer.Message.BodyText = PPSMsg
        PPSAttach = Chr$(34) & Trim(PPSRefreshDirectory) & Trim(PPSFilNam) & Chr$(34)
        oMailer.Message.AddAttachment PPSAttach

note - i've tried this with the chr$(34) included and excluded, neither one worked. I've also replaced the PPSAttach variable with "somedirectory\somefile.zip" and THAT worked.

Could you please let me know what I'm doing wrong here or could you please give me a suggestion as to what to do. The message comes thru, but with no attachment

Kurt Tietjen
Back to Top View Guests's Profile Search for other posts by Guests
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 02 June 2005 at 2:24pm | IP Logged Quote Alex

Have you tried to take a look at PPSAttach content?

Code:

PPSAttach = Chr$(34) & Trim(PPSRefreshDirectory) & Trim(PPSFilNam) & Chr$(34)
MsgBox PPSAttach


Chr$(34) chars should be excluded. Also, you're probably missing backslash character between folder name and filename.

You can try this:
Code:

PPSAttach = Trim(PPSRefreshDirectory) & "\" & Trim(PPSFilNam)
MsgBox PPSAttach


Make sure PPSAttach contains valid file path now. Also, it might be more reliable to include full path to PPSRefreshDirectory. This will eliminate problems caused by accessing folders which do not reside in your application's folder.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide