Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Invio e-mail con immagine

    Ciao a tutti,
    non riesco a fare l'invio, in asp, di un e-mail con un immagine all'interno o meglio, quando la ricevo l'immagine non si vede subito ma mi da la X per vederla devo sbloccare.
    Questo è il codice che sto usando:
    codice:
    <%@LANGUAGE="Vbscript"%>
    <%
    session.timeout=60 
    %>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <%
    dim html
    				
    html = html & "<HTML>"
    html = html & "<BODY bgcolor=#FFFFFF>"
    html = html & "<img src=http://www.miosito.it/provaemail/foto.jpg>"
    html = html & "</body>"
    html = html & "</html>"
    	
    DIM iMsg, Flds, iConf
    	
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields
    	
    Flds.Update
    	
    With iMsg
    Set .Configuration = iConf
    .To = "info@misito.it"
    .From = "info@misito.com"
    .Sender = "info@miosito.com"
    .Subject = "E-MAIL DA PROVA"
    .htmlBody = html
    .Send
    End With
    %>
    </body>
    </html>
    Tante e-mail mi arrivano con immagini e non danno problemi.. ho visto che il richiamo della foto è differente:
    nel mio <img src=http://www.miosito.it/provaemail/foto.jpg>
    negli altri che funzionano <img src=cid:00bb01c8b1dedfg$asdf332100001>


    Come posso risolvere?

    Fatemi sapere.
    GRazie mille!

  2. #2
    Potrà essere utile per qualcun altro.. io ho risolto così:
    codice:
    <%
    Const CdoReferenceTypeName = 1
    Dim objCDO, objBP
    Set objCDO = Server.CreateObject("CDO.Message")
    objCDO.MimeFormatted = True
    
    objCDO.From = "info@miosito.it"
    objCDO.Subject = "E-MAIL DA miosito"
    
    html = html & "<html>"
    html = html & "<div align=""center"">"
    html = html & "[img][/img]"
    html = html & "</div></html>"
    
    objCDO.HTMLBody = html
    
    Set objBP = objCDO.AddRelatedBodyPart(Server.MapPath("foto.jpg"), "foto.jpg", CdoReferenceTypeName)
    objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<foto.jpg>"
    objBP.Fields.Update
    
    objCDO.To = "lucafarigu@miosito.it"
    objCDO.Send
    %>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.