+ Reply to Thread
Results 1 to 5 of 5

Thread: Attaching images to send as an email in ASP

  1. #1
    TMAhahaha
    Guest

    Attaching images to send as an email in ASP

    Does anyone know how to upload images to send as an email attachment using ASP?







    Thanks in advance,

    Kev
    More Information:
    1. Please click on the link below to send an email to us, including the following information: attach clear images (jpegs) of the item and any marks/signatures
    2. Code to embed logo and other images while sending email; Author: Rajesh C Medackel; Section: ASP
    3. Define a custom SendEmail event, and let each page subscribe to the event
    4. When you send an email message, your outgoing mail server receives the message first
    5. asp", "Image Flip", "Apply transformations to an image before sending it to the browser
    6. Send us your thoughts about this lesson! Email this Lesson
    7. Top 17 Free Email Services Free Windows Email Programs MSN Hotmail Reviewed Cc: and Bcc: Send Email from a PHP Script
    8. Sometimes we need to transfer more information in emails so we attach files, presentations, images, etc
    9. We are able to compose 5000 personalized newsletters a minute with unique tracking links and images using ASPNETEMAIL

    More:


  2. #2
    bithuchidoan
    Guest

    here is a scrip that attaches the file from your server




    Code:




    aspSmartMail : Sample 5




    <%

    On error resume next

    Dim mySmartMail
    Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")

    ' Mail Server
    ' ***********
    mySmartMail.Server = "mail.yourdomain.com"
    mySmartMail.ServerPort = 25
    mySmartMail.ServerTimeOut = 35

    ' From
    ' ****
    mySmartMail.SenderName = "Your Name"
    mySmartMail.SenderAddress = "youremail@yourdomain.com"

    ' To
    ' **
    mySmartMail.Recipients.Add "yourfriend0@anydomain.com", "Friend0's name"
    mySmartMail.Recipients.Add "yourfriend1@anydomain.com", "Friend1's name"

    ' Carbon copy
    ' ***********
    mySmartMail.CCs.Add "yourfriend2@anydomain.com", "Friend2's name"

    ' Blind carbon copy
    ' *****************
    mySmartMail.BCCs.Add "yourfriend3@anydomain.com", "Friend3's name"

    ' Reply To
    ' ********
    mySmartMail.ReplyTos.Add "yourfriend4@anydomain.com", "Friend4's name"

    ' Message
    ' *******
    mySmartMail.Subject = "aspSmartMail Sample 5"
    mySmartMail.Body = "This mail which has been sent with aspSmartMail."

    ' Parameters
    ' **********
    mySmartMail.DateTime = "Wed, 23 febr 2000 12:00 0600"
    mySmartMail.Organization = "your Society Inc."
    mySmartMail.XMailer = "Your Web Application"
    mySmartMail.Priority = 1
    mySmartMail.ReturnReceipt = false
    mySmartMail.ConfirmRead = true
    mySmartMail.ContentType = "text/plain"
    mySmartMail.Charset = "us-ascii"
    mySmartMail.Encoding = "base64"

    ' Attached file
    ' *************
    mySmartMail.Attachments.Add Server.MapPath("\aspSmartMail\sample.txt"), false

    ' Send the message
    ' ****************
    mySmartMail.SendMail

    if err.number <> 0 then

    response.write("Error n° " & err.number - vbobjecterror & " = " & err.description & "
    ")

    else

    Response.Write "aspSmartMail has sent your message with this file as attachment :
    "
    Response.Write mySmartMail.Attachments.Item(1).FilePathName

    end if

    set mySmartMail = nothing

    %>


    More Information:
    1. com/ , this website is devoted to the errors that developers face which sending email using Asp
    2. send email for windows 95 98 NT 2000,mail merge,HTML Email,Advanced Mail list verify,unlimited recipients,command line,email program,free
    3. This same keylogger was next installed on a different test PC through another program's installer and then configured to send keystrokes captured in an email to a test email-id
    4. In all probability this will not change anytime soon, therefore I will demonstrate today how to send email via ASP
    5. In this article you will learn how to send email using ASP
    6. vbscript to send email exchange customer service manage email how do i email home videos prime minister gordon brown email address email mk colour gems diamond jaipur quest email address
    7. jpg"></td> <td><img src="images/email_address_text

  3. #3
    azz1123
    Guest

    INSERT.HTM

    Code:



    File Uploading with ASP




    File Uploading with ASP

    To see uploaded data click here











    Name :
    File :
     




    INSERT.ASP


    Code:


    <%
    Response.Buffer = True

    ' load object
    Dim load
    Set load = new Loader

    ' calling initialize method
    load.initialize

    ' File binary data
    Dim fileData
    fileData = load.getFileData("file")
    ' File name
    Dim fileName
    fileName = LCase(load.getFileName("file"))
    ' File path
    Dim filePath
    filePath = load.getFilePath("file")
    ' File path complete
    Dim filePathComplete
    filePathComplete = load.getFilePathComplete("file")
    ' File size
    Dim fileSize
    fileSize = load.getFileSize("file")
    ' File size translated
    Dim fileSizeTranslated
    fileSizeTranslated = load.getFileSizeTranslated("file")
    ' Content Type
    Dim contentType
    contentType = load.getContentType("file")
    ' No. of Form elements
    Dim countElements
    countElements = load.Count
    ' Value of text input field "name"
    Dim nameInput
    nameInput = load.getValue("name")
    ' Path where file will be uploaded
    Dim pathToFile
    pathToFile = Server.mapPath("uploaded/") & "\" & fileName
    ' Uploading file data
    Dim fileUploaded
    fileUploaded = load.saveToFile ("file", pathToFile)

    ' destroying load object
    Set load = Nothing
    %>



    File Uploading with ASP




    File Uploading with ASP

    To see uploaded files click here





















    File Name<%= fileName %>
    File Path<%= filePath %>
    File Path Complete<%= filePathComplete %>
    File Size<%= fileSize %>
    File Size Translated<%= fileSizeTranslated %>
    Content Type<%= contentType %>
    No. of Form Elements<%= countElements %>
    Name<%= nameInput %>





    <%
    If fileUploaded = True Then
    Response.Write fileName & " data uploaded..."
    Else
    Response.Write "File could not be uploaded..."
    Response.Write "
    Please select a file before hitting the 'Submit' button."
    End If
    %>













    Name :
    File :
     




    LOADER.ASP


    Code:

    <%
    ' -- Loader.asp --
    ' -- version 1.5.2
    ' -- last updated 12/5/2002
    '
    ' Faisal Khan
    ' faisal@stardeveloper.com
    ' www.stardeveloper.com
    ' Class for handling binary uploads

    Class Loader
    Private dict

    Private Sub Class_Initialize
    Set dict = Server.CreateObject("Scripting.Dictionary")
    End Sub

    Private Sub Class_Terminate
    If IsObject(intDict) Then
    intDict.RemoveAll
    Set intDict = Nothing
    End If
    If IsObject(dict) Then
    dict.RemoveAll
    Set dict = Nothing
    End If
    End Sub

    Public Property Get Count
    Count = dict.Count
    End Property

    Public Sub Initialize
    If Request.TotalBytes > 0 Then
    Dim binData
    binData = Request.BinaryRead(Request.TotalBytes)
    getData binData
    End If
    End Sub

    Public Function getFileData(name)
    If dict.Exists(name) Then
    getFileData = dict(name).Item("Value")
    Else
    getFileData = ""
    End If
    End Function

    Public Function getValue(name)
    Dim gv
    If dict.Exists(name) Then
    gv = CStr(dict(name).Item("Value"))

    gv = Left(gv,Len(gv)-2)
    getValue = gv
    Else
    getValue = ""
    End If
    End Function

    Public Function saveToFile(name, path)
    If dict.Exists(name) Then
    Dim temp
    temp = dict(name).Item("Value")
    Dim fso
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Dim file
    Set file = fso.CreateTextFile(path)
    For tPoint = 1 to LenB(temp)
    file.Write Chr(AscB(MidB(temp,tPoint,1)))
    Next
    file.Close
    saveToFile = True
    Else
    saveToFile = False
    End If
    End Function

    Public Function getFileName(name)
    If dict.Exists(name) Then
    Dim temp, tempPos
    temp = dict(name).Item("FileName")
    tempPos = 1 InStrRev(temp, "\")
    getFileName = Mid(temp, tempPos)
    Else
    getFileName = ""
    End If
    End Function

    Public Function getFilePath(name)
    If dict.Exists(name) Then
    Dim temp, tempPos
    temp = dict(name).Item("FileName")
    tempPos = InStrRev(temp, "\")
    getFilePath = Mid(temp, 1, tempPos)
    Else
    getFilePath = ""
    End If
    End Function

    Public Function getFilePathComplete(name)
    If dict.Exists(name) Then
    getFilePathComplete = dict(name).Item("FileName")
    Else
    getFilePathComplete = ""
    End If
    End Function

    Public Function getFileSize(name)
    If dict.Exists(name) Then
    getFileSize = LenB(dict(name).Item("Value"))
    Else
    getFileSize = 0
    End If
    End Function

    Public Function getFileSizeTranslated(name)
    If dict.Exists(name) Then
    temp = 1 LenB(dict(name).Item("Value"))
    If Len(temp) <= 3 Then
    getFileSizeTranslated = temp & " bytes"
    ElseIf Len(temp) > 6 Then
    temp = FormatNumber(((temp / 1024) / 1024), 2)
    getFileSizeTranslated = temp & " megabytes"
    Else
    temp = FormatNumber((temp / 1024), 2)
    getFileSizeTranslated = temp & " kilobytes"
    End If
    Else
    getFileSizeTranslated = ""
    End If
    End Function

    Public Function getContentType(name)
    If dict.Exists(name) Then
    getContentType = dict(name).Item("ContentType")
    Else
    getContentType = ""
    End If
    End Function

    Private Sub getData(rawData)
    Dim separator
    separator = MidB(rawData, 1, InstrB(1, rawData, ChrB(13)) - 1)

    Dim lenSeparator
    lenSeparator = LenB(separator)

    Dim currentPos
    currentPos = 1
    Dim inStrByte
    inStrByte = 1
    Dim value, mValue
    Dim tempValue
    tempValue = ""

    While inStrByte > 0
    inStrByte = InStrB(currentPos, rawData, separator)
    mValue = inStrByte - currentPos

    If mValue > 1 Then
    value = MidB(rawData, currentPos, mValue)

    Dim begPos, endPos, midValue, nValue
    Dim intDict
    Set intDict = Server.CreateObject("Scripting.Dictionary")

    begPos = 1 InStrB(1, value, ChrB(34))
    endPos = InStrB(begPos 1, value, ChrB(34))
    nValue = endPos

    Dim nameN
    nameN = MidB(value, begPos, endPos - begPos)

    Dim nameValue, isValid
    isValid = True

    If InStrB(1, value, stringToByte("Content-Type")) > 1 Then

    begPos = 1 InStrB(endPos 1, value, ChrB(34))
    endPos = InStrB(begPos 1, value, ChrB(34))

    If endPos = 0 Then
    endPos = begPos 1
    isValid = False
    End If

    midValue = MidB(value, begPos, endPos - begPos)
    intDict.Add "FileName", trim(byteToString(midValue))

    begPos = 14 InStrB(endPos 1, value, stringToByte("Content-Type:"))
    endPos = InStrB(begPos, value, ChrB(13))

    midValue = MidB(value, begPos, endPos - begPos)
    intDict.Add "ContentType", trim(byteToString(midValue))

    begPos = endPos 4
    endPos = LenB(value)

    nameValue = MidB(value, begPos, ((endPos - begPos) - 1))
    Else
    nameValue = trim(byteToString(MidB(value, nValue 5)))
    End If

    If isValid = True Then

    intDict.Add "Value", nameValue
    intDict.Add "Name", nameN

    dict.Add byteToString(nameN), intDict
    End If
    End If

    currentPos = lenSeparator inStrByte
    Wend
    End Sub

    End Class

    Private Function stringToByte(toConv)
    Dim tempChar
    For i = 1 to Len(toConv)
    tempChar = Mid(toConv, i, 1)
    stringToByte = stringToByte & chrB(AscB(tempChar))
    Next
    End Function

    Private Function byteToString(toConv)
    For i = 1 to LenB(toConv)
    byteToString = byteToString & chr(AscB(MidB(toConv,i,1)))
    Next
    End Function
    %>

    SHOW.ASP


    Code:

    <%
    ' -- show.asp --
    ' Shows a list of uploaded files

    Response.Buffer = True
    %>


    List of uploaded Files




    List of uploaded Files

    To upload files click here



    <%
    ' File System Object
    Dim fso
    Set fso = Server.CreateObject("Scripting.FileSystemObject")

    ' "Uploaded" Folder
    Dim folder
    Set folder = fso.GetFolder(Server.MapPath("uploaded/"))

    If folder.Size > 0 Then
    Response.Write ""
    Else
    Response.Write "
    • No Files Uploaded.
    "
    End If
    %>


    YOU WILL NEED TO CREATE A FOLDER NAMED "UPLOADED" in the folder where you place this files



    NOTE: THIS SCRIPTS DO NOT BELONG TO ME, THEY ARE THE SOLE IDENTITY OF THE PRODUCERS. HOPE THEY WILL BE USEFUL FOR YOU TO GET YOUR WORK DONE



    I know there should be some other ways but I am not sure which are they....

    I had the screepts saved somewhere but can't find them now.



    GOOD LUCK
    More Information:
    1. Yes, there are plenty of other articles that cover sending email via
    2. You can include text in the composition of your images, but you should send a description of your project separately as well
    3. [Guestbooks With CGIs] [Attaching Email Output To A CGI] [Guestbooks With Virtual Pages] [Guestbook CGIs] [One More Option (ASP)]
    4. E-mail (HTML), Send email messages as lively as a web page
    5. He then adds both versions to the MailMessage object and sends the email twice, first with HTML-receiving capabilities enabled and then as text
    6. Hi All, I am Not able to send emails using CDONTS
    7. SEND AN ATTACHMENT Windows Mobile, BlackBerry, and Palm OS use a similar process for attaching a file to an outgoing email message

  4. #4
    lizinhi
    Guest

    That's great thanks a lot
    More Information:
    1. If sending email is not successful we need to log that email in database to be able to send email in future
    2. So, you want to send automated email messages from your PHP application
    3. I will call EmailHelper class methods to send email in our case we have just one type of email if I had 10 different emails (of course with different content
    4. Link your PAX-it collection directly to MS-Outlook Outlook Express, or other email account, allowing images and documents to be sent directly from your PAX
    5. Output to PDF using Adobe FDF and send as an email attachment via ASP

+ Reply to Thread

Similar Threads

  1. script to send email too all email in textarea separated by coma
    can anyone give me a script to send email too all email in textarea separated by coma..
  2. How to send an email to +- 1 Million email addresses ?
    Hi ! I have a bit of a problem here... I bought myself an email list with over 1 Million email addresses for targeted traffic (no spam... list was...
  3. How to send an email using .NET
    Many .NET applications will require an email be sent out for various reasons. This article will give a quick examples on how to send an email using...
  4. cannot send email through php
    Hi, all.. i have a big problem here. I wish to send email through the php script.. but i don know what's wrong with it. it stated there email sent.....
  5. Send email with Google's email server with a non Google address?
    Is it possible to send hundreds or thousands of email using, for example, Google or Yahoo's email server with an email address based on Godaddy.com?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Welsh Yiddish