Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Automated mail

Options
  • 10-09-2008 10:13am
    #1
    Registered Users Posts: 224 ✭✭


    Hi All,

    Im currently trying to create an automated mailer with dynamic content in it. Im using the CDONTS technology. I have got it to fire off a mail and that is fine, but how can i design a professional looking mailer with images etc as opposed to just boring text. do you know of any tutorials available on this?

    Many thanks


Comments

  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Fancy emails are just HTML emails. Set the headers to be:

    Content-type: text/html

    And insert HTML in the body.


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    Do you mean something like this?
    <meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">


  • Registered Users Posts: 2,494 ✭✭✭kayos


    And then be prepaired for most of your mails to be blocked, marked as junk/spam or at least be converted to plain text.

    HTML Emails are the the devils work!


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    Hi Kayos,

    Im with you on that they can be a bit annoying alright. But luckily this is not a mass emailer. These mailer will sent to a specific customer in order for them to approve a job for production.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Correct me if i'm wrong but I don't see whats wrong with HTML mails - the post notifications on this very forum or in HTML so that they can give you a hyperlink.

    The Might Dubs - you have to set the headers of the email, thats not what the meta tags are for, you don't need them really, though Maybe some clients will detect that and render it as HTML. What ever your using, is there any way to modify headers or set to HTML format? - The headers would include teh To, From Reply-To, Subject fields of the email.


  • Advertisement
  • Registered Users Posts: 2,494 ✭✭✭kayos


    Webmonkey wrote: »
    Correct me if i'm wrong but I don't see whats wrong with HTML mails - the post notifications on this very forum or in HTML so that they can give you a hyperlink.

    HTML mails are generally frowned upon simply as they are the domain of spam mailers. A little image link to go to a server and pull down an image and hey presto they just confirmed your email address is active. This is why a lot of email clients will not automatically get images that are contained within HTML format emails. So you go to all the bother of having a nice looking HTML email just to have most email clients rip out all the images by default. Why send a mail that’s 5+ times the size of a normal mail esp if its for an application and most likely all the mails will be kept for audit purposes. There is nothing stopping you putting a url in a plain text email. Again if your mail from the application gets blocked by a spam filter your clients are not going to be able to approve anything.

    Then again I dislike mails with lots of embedded images as well because they just consume space needlessly. One place I worked in had the most god awful email sig requirements. Some business head came up with it and he never even considered the space used by his *ahem* work of art *ahem*. Our sys admin was out on long term sick leave at the time and when he came back we managed to get it changed back to good old plain text.

    I did an auto mailer for a client recently. Most of these mails were notification/reminder/action requests and many had URL’s. All plain text and all working lovely and exactly how they wanted. They had the use of HTML mails and all the nice images in the spec but once I showed them the space requirements based on the volume of mails they very quickly opted for the plain text route.


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    Hey Kayos,

    Some very valid points there. I think i might go for the plain text option then. Could i be so bold as to ask for a sample of one of these mails you did.

    its the body of the text bit imstruggling with. here is what i am using thus far...


    ***************

    <%@LANGUAGE=&quot;VBSCRIPT"%>
    <!--#include file="../Connections/Conn.asp" -->
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Request.QueryString("Id") <> "") Then
    Recordset1__MMColParam = Request.QueryString("Id")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_Spark08Conn_STRING
    Recordset1.Source = "SELECT * FROM dbo.tblArtworkApproval WHERE Id = " + Replace(Recordset1__MMColParam, "'", "''") + ""
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <%
    Dim myMail
    Set myMail = Server.CreateObject ("CDONTS.NewMail")
    myMail.From = (Recordset1.Fields.Item("Email").Value)
    myMail.To = (Recordset1.Fields.Item("SalesEmail").Value)
    myMail.Subject = "Test email using CDONTS"
    myMail.Body = "If you can read this, the mailing mechanism is functional" & vbCrLf & ""
    myMail.Send
    set myMail=nothing
    Response.Write("Your e-mail has been sent using both email accounts")
    %>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    kayos wrote: »
    HTML mails are generally frowned upon simply as they are the domain of spam mailers. A little image link to go to a server and pull down an image and hey presto they just confirmed your email address is active. This is why a lot of email clients will not automatically get images that are contained within HTML format emails. So you go to all the bother of having a nice looking HTML email just to have most email clients rip out all the images by default. Why send a mail that’s 5+ times the size of a normal mail esp if its for an application and most likely all the mails will be kept for audit purposes. There is nothing stopping you putting a url in a plain text email. Again if your mail from the application gets blocked by a spam filter your clients are not going to be able to approve anything.

    Then again I dislike mails with lots of embedded images as well because they just consume space needlessly. One place I worked in had the most god awful email sig requirements. Some business head came up with it and he never even considered the space used by his *ahem* work of art *ahem*. Our sys admin was out on long term sick leave at the time and when he came back we managed to get it changed back to good old plain text.

    I did an auto mailer for a client recently. Most of these mails were notification/reminder/action requests and many had URL’s. All plain text and all working lovely and exactly how they wanted. They had the use of HTML mails and all the nice images in the spec but once I showed them the space requirements based on the volume of mails they very quickly opted for the plain text route.
    Oh I agree with this alright, but having a HTML mail in general with no lniked images is not so harmful and it can make an improvment on the look of an email at the same time. Thats my point. Very valid points with images and spamming though


  • Registered Users Posts: 2,494 ✭✭✭kayos


    Well the system I did was in .NET 3.5 and based on my clients architecture. So in other words my code (If I had it or access to it) would not be of much help. The emails were nothing complex and again sorry but I don’t have any left on my mail server.

    But honestly they were easy to do. The hard parts where writing the thing so bloody generic and the way one bright spark in there decided to do some of the documents that were to be attached.

    Webmonkey wrote: »
    Oh I agree with this alright, but having a HTML mail in general with no lniked images is not so harmful and it can make an improvment on the look of an email at the same time. Thats my point. Very valid points with images and spamming though

    I get ya but I never understood why we had to move from a command prompt. Green text on black....teh sexy! So you can see what your trying to deal with here. I likes my coffee strong, my code clean and formatted and my emails in plain text. But thats just a matter of personnal choice.

    But the OP had intended on using images in HTML mails thats why I mentioned the spam/blocking thing.

    Its like this get the thing working in plain text and then if you have time and really would like to provide html email expand on it to allow that. Just make sure you give the user the option in what email format they would prefer to get.


  • Registered Users Posts: 1,045 ✭✭✭Bluefrog


    A quick Google on multipart email formatting might be of interest here. These allow you to send both plaintext and html formatted versions and the recipients' email clients decide how to display them.

    I should say that my preference would also be for plain text.

    Kayos I feel your pain on the signature thing - I constantly get mails here with monsterous sig images attached - drives me crazy!


  • Advertisement
  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    Hey guys,

    figured out my problem in the end. Was with the mymail.Subject field. had it both plain text and a recordset.

    once i stuck to plain text the rest of it worked.

    thanks for all the input guys.


Advertisement