close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Universal Email file attachment problem

Thread began 9/04/2009 3:35 am by steen120697 | Last modified 9/08/2009 3:16 pm by steen120697 | 2402 views | 7 replies


Universal Email file attachment problem

I use UE to send attachments to different users. I retrieve email and attachment (file2send) information from a database.

If the recordset contains just 1 record, everything works fine. More than 1 record and hell breaks lose (= hundreds of emails sent).

The file2send contains the physical path.

I'd appreciate som assistance, please...

Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_dbburner_STRING
Recordset1.Source = "SELECT * FROM LOGBOG where keycode = '" & keycode & "' and email = '" & email & "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1

Recordset1_numRows = 0
<!--#include file="../WA_Universal_Email/AspMail_VB.asp" -->
<!--#include file="../WA_Universal_Email/MailFormatting_VB.asp" -->
function WA_Universal_Email_1_SendMail(RecipientEmail)
dim MailObject, MailAttachments, MailBCC, MailCC, MailTo, MailBodyFormat, MailBody, MailImportance, MailFrom, MailSubject
MailAttachments = ""
MailBCC = ""
MailCC = ""
MailTo = ""
MailBodyFormat = ""
MailBody = ""
MailImportance = ""
MailFrom = "John Doe|WA|"
MailSubject = "Photos"

'Global Variables
gBodyFormat = ""

set WA_MailObject = WAUE_Definition("")

if (RecipientEmail <> "") then
set WA_MailObject = WAUE_AddRecipient(WA_MailObject,RecipientEmail)
'To Entries
end if

'Attachment Entries
while (NOT Recordset1.EOF)
set WA_MailObject = WAUE_AddAttachment(WA_MailObject,"" & cStr(Recordset1.Fields.Item("file2send").Value) & "")
if (Recordset1.CursorType > 0) then
end if

'BCC Entries

'CC Entries

'Character Set

'Body Format
set WA_MailObject = WAUE_BodyFormat(WA_MailObject,0)
MailBodyFormat = gBodyFormat

'Set Importance
set WA_MailObject = WAUE_SetImportance(WA_MailObject,"3")

'Start Mail Body
MailBody = MailBody & "Cool"
'End Mail Body

set WA_MailObject = WAUE_SendMail(WA_MailObject,MailAttachments,MailBCC,MailCC,MailTo,MailImportance,MailFrom,MailSubject,MailBody)

set WA_MailObject = nothing
end function
if ((NOT (Recordset1.EOF AND Recordset1.BOF))) then
'WA Universal Email object="AspMail"
'Send Loop Once Per Entry
while (NOT Recordset1.EOF)
WA_Universal_Email_1_SendMail("" & cStr(Recordset1.Fields.Item("email").Value) & "")
if (Recordset1.CursorType > 0) then
end if

'Send Mail All Entries
if (""<>"") then
end if
end if

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...