ASP Mailer Question

Discussion in 'ASP General' started by John Davis, Aug 17, 2003.

  1. John Davis

    John Davis Guest

    What is the **MOST** obvious reason why will this will fail (it's not syntax
    or anything specific to the object)?


    Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,
    ReplyTo, FromName, ToName, MailerPath, BCCEmail, Attachement)
    Set Mailer = Server.CreateObject("Persits.MailSender")
    if NOT isObject(Mailer) Then
    Mail = false
    Exit function
    End if
    Mailer.Host = MailerPath
    Mailer.Port = 80
    Mailer.From = FromEmail
    Mailer.FromName = FromName
    Mailer.AddReplyTo ReplyTo
    Mailer.AddAddress ToEmail
    Mailer.Subject = Subject
    Mailer.Body = Message
    If Format="HTML" Then
    Mailer.IsHTML = True
    Else
    Mailer.IsHTML = False
    End If
    If IsArray(Attachement) Then
    For Each AttFile In Attachement
    if(AttFile <> "") Then Mailer.AddAttachment AttFile
    Next
    Else
    If Attachement<>"" Then
    Mailer.AddAttachment Attachement
    End If
    End If

    On Error Resume Next
    Mailer.Send
     
    John Davis, Aug 17, 2003
    #1
    1. Advertising

  2. John Davis

    Evertjan. Guest

    John Davis wrote on 17 aug 2003 in microsoft.public.inetserver.asp.general:
    > If Format="HTML" Then
    > Mailer.IsHTML = True
    > Else
    > Mailer.IsHTML = False
    > End If


    Bypassing yous specific question, the above is needlessly explicit and can
    be shortened to:

    Mailer.IsHTML = (Format="HTML")

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Aug 17, 2003
    #2
    1. Advertising

  3. John Davis

    Curt_C [MVP] Guest

    remove the "On Error Resume Next" and you should get a nice error message

    --
    ----------------------------------------------------------
    Curt Christianson (Software_AT_Darkfalz.Com)
    Owner/Lead Designer, DF-Software
    http://www.Darkfalz.com
    ---------------------------------------------------------
    ...Offering free scripts & code snippits for everyone...
    ---------------------------------------------------------


    "John Davis" <> wrote in message
    news:...
    > What is the **MOST** obvious reason why will this will fail (it's not

    syntax
    > or anything specific to the object)?
    >
    >
    > Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,
    > ReplyTo, FromName, ToName, MailerPath, BCCEmail, Attachement)
    > Set Mailer = Server.CreateObject("Persits.MailSender")
    > if NOT isObject(Mailer) Then
    > Mail = false
    > Exit function
    > End if
    > Mailer.Host = MailerPath
    > Mailer.Port = 80
    > Mailer.From = FromEmail
    > Mailer.FromName = FromName
    > Mailer.AddReplyTo ReplyTo
    > Mailer.AddAddress ToEmail
    > Mailer.Subject = Subject
    > Mailer.Body = Message
    > If Format="HTML" Then
    > Mailer.IsHTML = True
    > Else
    > Mailer.IsHTML = False
    > End If
    > If IsArray(Attachement) Then
    > For Each AttFile In Attachement
    > if(AttFile <> "") Then Mailer.AddAttachment AttFile
    > Next
    > Else
    > If Attachement<>"" Then
    > Mailer.AddAttachment Attachement
    > End If
    > End If
    >
    > On Error Resume Next
    > Mailer.Send
    >
    >
    >
    >
     
    Curt_C [MVP], Aug 18, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Mailer, Newsletter script in asp/asp.net

    =?Utf-8?B?Sm9l?=, Feb 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    923
    Juan T. Llibre
    Feb 23, 2005
  2. D. Shane Fowlkes
    Replies:
    4
    Views:
    623
    =?Utf-8?B?a2VpdGhpbnNhYw==?=
    Jun 9, 2005
  3. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,149
    Andrzej Adam Filip
    Mar 31, 2008
  4. Raphael Gluck

    ASP dundas mailer question

    Raphael Gluck, Aug 10, 2003, in forum: ASP General
    Replies:
    6
    Views:
    242
    Raphael Gluck
    Aug 11, 2003
  5. Mark Creelman

    Multiple field form for this ASP mailer script

    Mark Creelman, Apr 3, 2004, in forum: ASP General
    Replies:
    3
    Views:
    561
    Steven Burn
    Apr 3, 2004
Loading...

Share This Page