Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

Sobre imagenes en plantillas.

Estas en el tema de Sobre imagenes en plantillas. en el foro de Visual Basic clásico en Foros del Web. Hola a todos, Estoy realizando una aplicación que envia plantillas por correo atraves de outlook. Esto funciona, sin embargo desde hace un tiempo intento que ...
  #1 (permalink)  
Antiguo 24/12/2013, 04:28
 
Fecha de Ingreso: noviembre-2013
Ubicación: Barcelona
Mensajes: 33
Antigüedad: 10 años, 5 meses
Puntos: 0
Sobre imagenes en plantillas.

Hola a todos,

Estoy realizando una aplicación que envia plantillas por correo atraves de outlook.

Esto funciona, sin embargo desde hace un tiempo intento que funcione con imagenes. Las imagenes vienen en las propias plantillas en html.

Cuando las envio con el siguiente codigo, el cliente de correo no ve las imagenes.

Dichas he intentado con html filtrado, he copiado el codigo incrustando la imagen como embed dentro del html pero continuo con el mismo problema, sólo me ha funcionado apuntando las imagenes hacia internet con un servidor de imagenes tipo photobuquet, el problema es que el proxy no deja acceso a photobucket.

Código:
 'References for templates.
    Dim myStreamReaderL1 As System.IO.StreamReader
    Dim myStr As String
    Dim path As String
    Dim item As Outlook.MailItem
    Dim SigString As String
    Dim Signature As String
    Dim Body As String = Nothing
    Dim subject As String

    'READ TEMPLATES TO BE SEND
    Private Sub readertemplate()
        Try
            myStreamReaderL1 = System.IO.File.OpenText(path)
            myStr = myStreamReaderL1.ReadToEnd()
            myStreamReaderL1.Close()

            Dim comment As String = CommentTMPTxt.Text + vbNewLine & vbNewLine

            myStr = myStr.Replace("[NAME]", UserTMPTxt.Text)
            myStr = myStr.Replace("[NUMINC1]", IncTMPTxt.Text)
            myStr = myStr.Replace("[NUMINC2]", IncTMPTxt.Text)
            If Not CommentTMPTxt.Text = "" Then
                myStr = myStr.Replace("[COMMENT]", comment)
            ElseIf CommentTMPTxt.Text = "" Then
                myStr = myStr.Replace("[COMMENT]", "")
            End If
            myStr = myStr.Replace("[ISSUE]", IssueTMPTxt.Text)

            If EmailTMPTxt.Text = "" Or IncTMPTxt.Text = "" Then
                MsgBox("Email addresss and Incident number is empty", MsgBoxStyle.Exclamation)
            ElseIf Not EmailTMPTxt.Text = "" Or IncTMPTxt.Text = "" Then
                item = olApp.CreateItem(Outlook.OlItemType.olMailItem)
                item.To = EmailTMPTxt.Text
                item.BodyFormat = OlBodyFormat.olFormatHTML
                item.HTMLBody = myStr
                'USING HAS A TEST
                'item.SentOnBehalfOfName = "[email protected]"
                item.SentOnBehalfOfName = CC1Emailadd
                If LanguageCB.Text = "Spanish" Then
                    item.Subject = "CC1 - Numero de Incidencia " + IncTMPTxt.Text
                ElseIf LanguageCB.Text = "French" Then
                    item.Subject = "CC1 - numéro de l'incident " + IncTMPTxt.Text
                ElseIf LanguageCB.Text = "English" Then
                    item.Subject = "CC1 - Incident number " + IncTMPTxt.Text
                ElseIf LanguageCB.Text = "German" Then
                    item.Subject = "CC1 - Incident-Nummer " + IncTMPTxt.Text
                End If

                item.Send()
                MsgBox("Mail has been sent")
            End If

        Catch
            MsgBox("Template can't be found. Please contact a L2 Analyst", MsgBoxStyle.Critical, vbOKOnly)
            Threading.Thread.Sleep(60000)
        End Try
    End Sub


    'SEND TEMPLATES.
    Private Sub SendTMPBT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendTMPBT.Click
        Dim olAccounts As Outlook.Accounts
        olApp = New Outlook.Application()
        olSession = olApp.Session
        olAccounts = olSession.Accounts

        If LanguageCB.Text = "Language" Then
            MsgBox("Please choose the language and press sent", MsgBoxStyle.Information, vbOKOnly)
        ElseIf Not LanguageCB.Text = "Language" Then


            'CC1 SPANISH
            If tempCB.Text = "CC1 email" And LanguageCB.Text = "Spanish" Then
                'Holidays conditional.
                If WeendoffCK.Checked Then
                    'if it is holiday or weekend.
                    path = "\\sfs.corp\Projects\ICT\SERVICEDESK_SHARE\SD_Only\Tools\JLTool\Template\CC1\CC1SPANISHholidays.html"
                ElseIf Not WeendoffCK.Checked Then
                    'if it is not holiday or weekend.
                    path = "\\sfs.corp\Projects\ICT\SERVICEDESK_SHARE\SD_Only\Tools\JLTool\Template\CC1\CC1SPANISH.html"
                End If

                readertemplate()

            ElseIf tempCB.Text = "CC1 email" And LanguageCB.Text = "English" Then
                'Holidays conditional.
                If WeendoffCK.Checked Then
                    'if it is holiday or weekend.
                    path = "\\sfs.corp\Projects\ICT\SERVICEDESK_SHARE\SD_Only\Tools\JLTool\Template\CC1\CC1ENGLISHholidays.html"
                ElseIf Not WeendoffCK.Checked Then
                    'if it is not holiday or weekend.
                    path = "C:\Users\joserodriguezan\Desktop\CC1\CC1ENGLISH.html"
                End If

                readertemplate()
End If
Muchas gracias,

Etiquetas: ado, imagenes, todo, vb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:13.