Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2008, 04:10 AM
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with cdo - big attachement - time out

Hi everyone

I have a problem with some code that i have in some page that i want to do this:

There is some form with some fields:

- 5 textfields
- 1 filefield

When all fields are full and the user choose the file to send, the page, add the data to database, and upload the file to one folder in the webserver named upload. Next there is one query to the database to know the name of the last file that was uploaded, to use in an automatic mail send with attachement.
Everything is working to little files, but when i choose a bigger file (2 mb), he starts sending the file, but there is a timeout because the file is bigger. The message only use the attachement if it is uploaded 1st.
How can i resolve this, i have no idea!

The code above is part of the query and sending of the mail with attachements:

---------------------------------------------------------------

'create and open database to know the last name of the file uploaded to be use in the mail
set connid = server.CreateObject ("ADODB.Connection")
connid.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("promotor.mdb") & ";"

set rsid = server.CreateObject ("ADODB.Recordset")
rsid.Open "SELECT * from consulta1 ", connid, 1, 2
teste = rsid("formulariocandidatura")
' send email
     set myMail=CreateObject("CDO.Message")
    myMail.Subject="Formulario de Candidatura"
    myMail.From=promotor.EmailPromotor.CurrentValue
    'myMail.To="[email protected]"
    myMail.To="[email protected]"

    'HTML
    dim strHTML
    strHTML = "<HTML>"
    strHTML = strHTML & "<HEAD>"
    strHTML = strHTML & "<BODY>"
    strHTML = strHTML & "<b> Nome: " & promotor.NomePromotor.DbValue &"</b></br>"
    strHTML = strHTML & "<b> NIF: " & promotor.NifPromotor.DbValue &"</b></br>"
    strHTML = strHTML & "<b> Email: " & promotor.EmailPromotor.DbValue &"</b></br>"
    strHTML = strHTML & "<b> Telefone: " & promotor.TelefonePromotor.DbValue &"</b></br>"
    strHTML = strHTML & "<b> Nome do Consultor: " & promotor.NomeConsultor.DbValue &"</b></br>"
    strHTML = strHTML & "<b> Email do Consultor: " & promotor.EmailConsultor.DbValue &"</b></br>"
    strHTML = strHTML & "</BODY>"
    strHTML = strHTML & "</HTML>"
    myMail.HTMLbody = strHTML
    'myMail.TextBody="Nome do promotor: " & promotor.NomePromotor.DbValue
    'myMail.TextBody="Nif: " & promotor.NifPromotor.DbValue

'use the file uploaded in the remote server

myMail.AddAttachment ("e:\hosting\ideram.pt\rootweb\upload\" & teste)

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

myMail.Configuration.Field.Item(cdoSMTPConnectionT imeout) = 10000

'Name or IP of Remote SMTP Server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.ideram.pt"

'Server port (typically 25)
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

myMail.Configuration.Fields.Update

'==End remote SMTP server configuration section==

'send email
myMail.Send
'close the myMail object
set myMail=nothing
'close database
rsid.close
connid.close
set rsid=nothing
set connid=nothing


 
Old April 2nd, 2008, 05:06 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Are you using Windows 2003 IIS 6.0? I suspect so because its file upload limit is set to 2Mb by default in the metabase file.

To alter - Open your metabase.XML which is located in c:\Windows\System32\Inetsrv find the line "AspMaxRequestEntityAllowed" and change it to, for example "1073741824". This is 1GB - of course you can enter another value to suite your needs.

Wind is your friend
Matt
www.elitemarquees.com.au





Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a big problem in VB 2005 !!!! aeroboy32000 Visual Basic 2005 Basics 3 October 24th, 2007 09:40 PM
facing big problem Manish Malhotra Classic ASP Basics 1 June 19th, 2006 01:35 PM
Regular Expression (Big Problem) vinod_yadav1919 Javascript How-To 6 November 3rd, 2004 05:24 AM
Big problem with VB + MSDE 7 predal Pro VB 6 2 April 2nd, 2004 03:44 AM
Getting at Access2000 with DAO - big problem Iblys Access VBA 1 September 25th, 2003 01:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.