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