Pure ASP Upload Add On Pack Support Product Page

This topic was archived

sending uplaod file to mutiple emails

Asked 23 Jul 2007 19:16:04
1
has this question
23 Jul 2007 19:16:04 elyas naim posted:
Hi there

how can i send the uplaoded file to multiple emails with record set.

currently when i select the email field it only sends one email not to all emails in record set.

and i am using cdo mail.

Replies

Replied 24 Jul 2007 12:41:35
24 Jul 2007 12:41:35 Georgi Kralev replied:
Hi Elyas,

Pure Asp Upload Add on Pack does not support such functionality.

But, you could send multiple emails by providing multiple recipient (from your recordset) and assign them to Email or BccEmail.

This can be accomplished by modifying the generated code for Mail Uploaded Files.
I have provided one example of how the modified code my look like:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
' *** Mail Uploaded Files 1.8.0
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Dim MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
MUF_FromName = "Georgi"
MUF_FromEmail = " "
MUF_ToName = "Georgi"
MUF_ToEmail = " "
Row_Count = 1
While (NOT rsEmails.EOF)
If Row_Count &gt;1 Then
MUF_Bcc = MUF_Bcc & ";" & rsEmails.Fields.Item("Email".Value
Else
MUF_Bcc = rsEmails.Fields.Item("Email".Value
End IF
Row_Count = Row_Count + 1
rsEmails.MoveNext()
Wend
MUF_Subject = "Test"
MUF_Body = "Test Mail"
MUF_SendHtml = false
MUF_checkErrors = true
MUF_deleteFiles = false
MUF_RedirectURL = ""
MUF_SmtpServer = ""
MUF_MailerType = "CDO"
MailUploadedFiles pau_thePath, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
end if
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

This code read the all the emails from Email field and assign them to BccEmail (MUF_Bcc variable).

I hope this will help you.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 25 Jul 2007 08:53:17
25 Jul 2007 08:53:17 elyas naim replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi Elyas,

Pure Asp Upload Add on Pack does not support such functionality.

But, you could send multiple emails by providing multiple recipient (from your recordset) and assign them to Email or BccEmail.

This can be accomplished by modifying the generated code for Mail Uploaded Files.
I have provided one example of how the modified code my look like:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
' *** Mail Uploaded Files 1.8.0
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Dim MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
MUF_FromName = "Georgi"
MUF_FromEmail = " "
MUF_ToName = "Georgi"
MUF_ToEmail = " "
Row_Count = 1
While (NOT rsEmails.EOF)
If Row_Count &gt;1 Then
MUF_Bcc = MUF_Bcc & ";" & rsEmails.Fields.Item("Email".Value
Else
MUF_Bcc = rsEmails.Fields.Item("Email".Value
End IF
Row_Count = Row_Count + 1
rsEmails.MoveNext()
Wend
MUF_Subject = "Test"
MUF_Body = "Test Mail"
MUF_SendHtml = false
MUF_checkErrors = true
MUF_deleteFiles = false
MUF_RedirectURL = ""
MUF_SmtpServer = ""
MUF_MailerType = "CDO"
MailUploadedFiles pau_thePath, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
end if
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

This code read the all the emails from Email field and assign them to BccEmail (MUF_Bcc variable).

I hope this will help you.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>


Hi Georgi

I used ur code for To Field and the code excuteds fine i dont get any error messages.

but the email bounces back to me sayign it cant be deliverd. i am using ISS and CDO Mail. HERE IS MY CODE
.........................................................................................................................................................


' *** Mail Uploaded Files 1.8.0
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Dim MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
MUF_FromName = "Elyas"
MUF_FromEmail = " "
Row_Count = 1
While (NOT rsEmails.EOF)
If Row_Count &gt;1 Then
MUF_ToName = MUF_ToName & ";" & rsEmails.Fields.Item("id".Value
MUF_ToEmail= MUF_ToEmail &";" & rsEmails.Fields.Item("emails".Value
Else
MUF_ToName = rsEmails.Fields.Item("id".Value
MUF_Bcc = rsEmails.Fields.Item("emails".Value
End IF
Row_Count = Row_Count + 1
rsEmails.MoveNext()
Wend
MUF_Bcc =""
MUF_Subject = "Elyas- Multiseremail"
MUF_Body = "Testing Multiuser Emaiil Body"
MUF_SendHtml = false
MUF_checkErrors = false
MUF_deleteFiles = false
MUF_RedirectURL = "send.asp"
MUF_SmtpServer = ""
MUF_MailerType = "CDO"
MailUploadedFiles pau_thePath, MUF_FromName, MUF_FromEmail, MUF_ToName, MUF_ToEmail, MUF_Bcc, MUF_Subject, MUF_Body, MUF_SendHtml, MUF_checkErrors, MUF_deleteFiles, MUF_RedirectURL, MUF_SmtpServer, MUF_MailerType
end if
.........................................................................................................................................

When i use the same code on Bcc it works fine but all rceptiants name is the same and to email field is all set to my email.

thanks for ur help
Replied 25 Jul 2007 10:19:49
25 Jul 2007 10:19:49 Georgi Kralev replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>but the email bounces back to me sayign it cant be deliverd. i am using ISS and CDO Mail<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Check if the emails from your recordset are valid.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>When i use the same code on Bcc it works fine but all rceptiants name is the same and to email field is all set to my email.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

I believe this issue is due to your recordset. Make sure that you have selected more than one record (To do this display all the selected records).

Also, ensure that the record pointer is at the first record.

For example you can add the following line before the while loop:
rsEmails.MoveFirst

The resulting code may look like this:
.......
Row_Count = 1
rsEmails.MoveFirst
While (NOT rsEmails.EOF)
..........

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 25 Jul 2007 17:24:06
25 Jul 2007 17:24:06 elyas naim replied:
HI George

my reocrdset contains 3 emails. and they are all valid emails. this is the message i get on bounced back email.
..........................................................................

Reporting-MTA: dns;ncorp
Received-From-MTA: dns;ncorp
Arrival-Date: Thu, 26 Jul 2007 00:19:17 +1000

Final-Recipient: rfc822;; ; ;
Action: failed
Status: 5.1.3

...............................................................................................................................................


This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

; ; ;

......................................................................................................



Replied 27 Jul 2007 11:31:01
27 Jul 2007 11:31:01 Georgi Kralev replied:
Hi Elyas,

It looks like there is a problem with the code that generates your mail addresses. Check the <b>;</b> character at the beginning:

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> ; ; ; <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Also, I have forgotten to mention that when it is used to Email (MUF_ToEmail) and CDO the email are formated:

There are added quotation mark around MUF_ToName variable. And &lt; and &gt; characters around the string assigned to MUF_ToEmail variable. All this is combined into string with the following formation: "Recipient Name" &lt; &gt; ).

For more information check line# 202 of incPUAddOn.asp:
if MUF_ToName &lt;&gt; "" then MUF_To = """" & MUF_ToName & """ &lt;" & MUF_ToEmail & "&gt;"

Therefore, if you want to send emails to multiple recipients you should ensure the correct format of the recipient list.

For example:
If you want to include the names of the recipients you should remove &lt; &gt; characters from line# 202 and format the recipient personally:
if MUF_ToName &lt;&gt; "" then MUF_To = """" & MUF_ToName & """ " & MUF_ToEmail & ""

And change the Mail Uploaded Files code to format the recipient:
Row_Count = 1
rsEmails.MoveFirst
While (NOT rsEmails.EOF)
If Row_Count &gt; 1 Then
MUF_ToEmail = MUF_ToEmail & """" &rsEmails.Fields.Item("Name".Value & """"&"&lt;" & rsEmails.Fields.Item("Email".Value & "&gt;;"
Else
MUF_ToEmail = "&lt;" & rsEmails.Fields.Item("Email".Value & "&gt;;"
End IF
Row_Count = Row_Count + 1
rsEmails.MoveNext()
Wend

The Name field contains the name of the recipients, Email the email.

I hope this will help you.

<b>Note:</b> Have in mind that all this solutions and modification of original code of Mail Uploaded Files come without support or warranty of any kind.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 24 Jun 2009 07:55:49
24 Jun 2009 07:55:49 Hans Kiesouw replied:
Hi there,

I have a similar process that I would like to use and in addition to the multiple messages, I would also like to store these in a database.

I do have an existing process where single messages are sent and stored, but with multiple "To" addresses, I would need to modify this and would like to keep the original data structure the same.

How would I then modify the code so that I can store multiple records with the different "To" addresses, without having to make a change to the current table structure? I do need to keep the existing records.

Thanks

Hans
Replied 27 Jul 2009 11:00:29
27 Jul 2009 11:00:29 Hans Kiesouw replied:
I have tried to use the modified code as indicated above, but it just does not send at all. I don't get any errors, I even commented out the line "on error resume next" in the incPAUAddOn.asp file, but it appeared to do everything, even upload the attached files, but no message was sent.

The mailer is used in conjunction with Pure Upload 2 (I just bought Upload 3 and that just won't work it returns an error that the DotNet is not installed, which it is), inserts the message into a database and our clients are able to review all the messages sent on line, together with the images, if any, that were uploaded.

I am getting rather disappointing with the support levels from DMX Zones and not even sure if these posts are read.

Hans

Reply to this topic