SMTP truncating mail

dubmunkey

Registered User.
Local time
Today, 13:06
Joined
Jan 6, 2006
Messages
62
Hi all,

i have an access db which uses a vb command to piece together data fields into an email which is sent via smtp, the problem ive recently encountered is that the mails are being truncated, they don't seem to truncate at the same number of characters, but after 17 lines...

ive included the code below, anyone got any ideas?

Code:
Code:
'Please note that we are using thet free software Bmail to do this....
'http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm
'====================================================================================
'       Command Line SMTP Emailer V1.07
'       Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
'       Usage:     bmail [options]
'            -s    SMTP Server Name
'            -p    SMTP Port Number (optional, defaults to 25)
'            -t    To: Address
'            -f    From: Address
'            -b    Text Body of Message (optional)
'            -h    Generate Headers
'            -a    Subject (optional)
'            -m    Filename (optional) Use file as Body of Message
'            -c    Prefix above file with CR/LF to separate body from header
'            -d    Debug (Show all mail server communications)
'====================================================================================

'When using the Bmail.exe, ensure that it is in a fully secure area of the network.

'You must also set the file to hidden

'Your users will need read and execute privaliges on both share and file.

'You could use Bmail to fake an email from your boss to the accounts department to force a pay rise


'This is the name of the current PGS email server,
'to be modified by Network Manager
Const SMTPServer = "termite.pgs.org.uk"
Const BmailLoci = "\\Draugr\PGS_SS_APPS\bmail"


Option Compare Database

'=====================================================================================
'The notes above will indiicate what arguments can be used with Bmail, we are only writing to
'produce one mail with a simple text message.
Sub ShellMail(t As String, f As String, b As String, a As String)
 'declare the shell event
 Dim RetVal As Variant
 'declare the shell script
 Dim shellscript As String
 
 'As we are using a third party SMTP service, we don't know what the [censored] would happen
 'if any strange error occured
 On Error GoTo BmailError
 
 'test for BmailLoci, if not around then we quit the sub
 If Dir(BmailLoci & ".exe", vbHidden) = "" Then
  Call MsgBox("You do not have access to Bmail, no mail will be sent", vbCritical, "Bmail/Shell Error")
  Exit Sub
 End If

 'first we build up our shell script which at this point will contain the email
 shellscript = BmailLoci
 'set server
 shellscript = shellscript & " -s " & SMTPServer
 'set recipiant, ,need the char 34 as we are shelling spaces
 shellscript = shellscript & " -t " & Chr(34) & t & Chr(34)
 'set sender, need the char 34 as we are shelling spaces
 shellscript = shellscript & " -f " & Chr(34) & f & Chr(34)
 'set text Body, need the char 34 as we are shelling spaces
 shellscript = shellscript & " -b " & Chr(34) & b & Chr(34)
 'set subject
 shellscript = shellscript & " -a " & Chr(34) & a & Chr(34)
 
 'then is we have what we want, we shell and send (in background)
 RetVal = Shell(shellscript, vbHide)
 Exit Sub
BmailError:
 Call MsgBox("There is a problem using Bmail, please contact your IS/IT services", vbCritical, "Bmail/Shell Error")
End Sub





greg
 

Users who are viewing this thread

Back
Top Bottom