Mail join en ASP
bolo
-
bolo -
bolo -
Bonjour,
j'aimerai envoyer un mail et que l'utilisateur puisse joindre un fichier de sons disque dur
Attachfile fonctionne pas , je crois que c juste pour un fichier deja dns le serveur si je me trompe pas
merci
j'aimerai envoyer un mail et que l'utilisateur puisse joindre un fichier de sons disque dur
Attachfile fonctionne pas , je crois que c juste pour un fichier deja dns le serveur si je me trompe pas
merci
1 réponse
-
j'arrive a envoyer des mel pour la soummission d'un site ou news mais pour la soumission d'une image , la j'ai rien ni uploade ,ni rien pourtant j'ai verifier les non et tout
le fichier des formulaire 'submit.asp'
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Soumettre/Submit</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../css/texte3.css" rel="stylesheet" type="text/css">
</head>
<body background="images/submit.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="465" border="0" cellpadding="0" cellspacing="0" class="texte">
<tr>
<td height="46" colspan="5"> </td>
</tr>
<tr>
<td width="31" rowspan="7"> </td>
<td colspan="3">lien/link</td>
<td width="9" rowspan="7"> </td>
</tr>
<tr>
<td colspan="3" align="center"><form name="form1" method="post" action="edit_submit.asp">
<input name="mail_link" type="text" class="formulaire" id="mail_link" value="mail">
<input name="link" type="text" class="formulaire" id="link" value="http://">
<input name="submit_link" type="submit" class="formulaire" id="submit_link" value="Submit">
</form></td>
</tr>
<tr>
<td colspan="3">Image/Picture</td>
</tr>
<tr>
<td colspan="3" align="center">
<form action="edit_submit.asp" method="post" enctype="multipart/form-data" name="form2">
<input name="mail_picture" type="text" class="formulaire" id="mail_picture" value="mail">
<input name="picture" type="file" class="formulaire" id="picture">
<input name="submit_picture" type="submit" class="formulaire" id="submit_picture" value="Submit">
</form>
</td>
</tr>
<tr>
<td colspan="3">Nouvelle/News</td>
</tr>
<form name="form3" method="post" action="edit_submit.asp">
<tr>
<td width="222" rowspan="2" align="center"> <textarea name="new_texte" cols="40" rows="7" class="formulaire" id="new_texte"></textarea>
</td>
<td width="143" height="55"><input name="nom" type="text" class="formulaire" id="nom"></td>
<td width="60" rowspan="2" valign="middle"><input name="submit_new" type="submit" class="formulaire" id="submit_new" value="Submit"></td>
</tr>
<tr>
<td><input name="mail_new" type="text" class="formulaire" id="mail_new" value="mail"></td>
</tr>
</form>
</table>
<%response.write(request.form("mail_picture"))%>
</body>
</html>
la page traitant les mels 'edit_submit.asp'
<%
'envoi un mel contenant le lien
If request.form("submit_link") <> "" then
titre="soumettre un site"
mail=request.form("mail_link")
texte=request.form("link")
End if
'soumission d'une image
If request.form("submit_picture") <> "" then
response.write(request.form("mail_picture"))
'uploader le fichier-----------------------------------------------------------
On Error Resume Next
Dim mySmartUpload
Dim intCount
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
'seulement les fichier jpg et gif
mySmartUpload.AllowedFilesList = "jpg,gif"
mySmartUpload.DeniedFilesList = "exe,bat,asp"
mySmartUpload.DenyPhysicalPath = True
' seul les fichier plus petit que 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 50000
' Upload
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("../../Upload/")
' Trap errors
' ***********
If Err Then
Response.Write("<b>Mauvaise Séléction : </b>" & Err.description)
Else
Response.Write(intCount & " file(s) uploaded.")
End If
'fin du fichier uploader-----------------------------------------------------
titre="soumettre un image"
mail=request.form("mail_picture")
texte= mySmartUpload.file
end if
' soumission d'un news
if request.form("submit_new") <> "" then
titre="soumettre une nouvelle"
mail=request.form("mail_new")
texte=request.form("new_texte")
end if
'fin
Set Mailer = Server.CreateObject("CDONTS.NewMail")
Mailer.To = "malavoi@meloo.com"
Mailer.From = mail
Mailer.Subject = titre
if request.form("submit_picture") <> "" then
Mail.AttachFile ServerMapPath("../../Upload/"&texte)
end if
Mailer.Body = texte
Mailer.Send
%>