trouble with AspEmail

Results 1 to 3 of 3

Thread: trouble with AspEmail

  1. #1
    Tim S. Guest

    Default trouble with AspEmail

    I am trying to e-mail everyone in a database through a loop. One by one. Whenever I start the script, I get an error saying "Domain Name Required". This has been driving me crazy for a long time and any help is appreciated. Here&#039;s the code...<BR><BR>-----------------------------------------------------------<BR>&#060;!-- #include file="DBFunctions.asp"--&#062;<BR>&#060;%<BR>&#039; declarations<BR>Dim strTo, strFrom, strSubject, strBody, strFileAttach &#039; e-mail contents<BR>Dim ObjRec &#039; recordset object<BR>Dim ObjMail &#039; E-mail object<BR><BR>&#039; definitions<BR>strFrom = Request.Form("txtFrom")<BR>strSubject = Request.Form("txtSubject")<BR>strBody = Request.Form("txtBody")<BR>strFileAttach = Request.Form("txtFileAttach")<BR>Set ObjRec = Server.CreateObject("ADODB.Recordset")<BR>Set ObjMail = Server.CreateObject("Persits.MailSender")<BR><BR>c all OpenDB<BR><BR>&#039; open the table containing the users&#039; information<BR>ObjRec.Open "SELECT * FROM Personal", conn<BR><BR>&#039; initialize the E-mail fields<BR>ObjMail.Host = "" <BR>ObjMail.From = strFrom<BR>ObjMail.FromName = "Al-Kitab Mailing List"<BR>ObjMail.AddReplyTo ""<BR>ObjMail.Subject = strSubject<BR>ObjMail.Body = strBody <BR>ObjMail.AddAttachment strFileAttach<BR><BR>&#039; send the e-mails<BR>Do While Not ObjRec.EOF<BR> &#039; get the next e-mail address<BR> ObjMail.AddAddress ObjRec("Personal_Email"), ObjRec("Personal_FirstName") + " " + ObjRec("Personal_LastName")<BR> &#039; send the mail<BR> ObjMail.Send<BR> &#039; move to the next record<BR> ObjRec.MoveNext<BR>Loop<BR><BR>Response.Write("You r e-mail has been successfully broadcasted.")<BR><BR>&#039; free the e-mail object<BR>Set ObjMail = Nothing<BR><BR>&#039; close and disconnect from the database<BR>ObjRec.Close<BR>Set ObjRec = Nothing<BR><BR><BR>Call CloseDB<BR>%&#062;<BR>-----------------------------------------------------------

  2. #2
    Join Date
    Dec 1969

    Default RE: trouble with AspEmail

    ObjMail.Host = "<BR><BR>your this line created problem please write <BR>ObjMail.Host = ""<BR><BR>I thik it will be work

  3. #3
    Join Date
    Dec 1969

    Default RE: trouble with AspEmail

    Here is what you&#039;re missing:<BR> Set ObjMail= Server.CreateObject("Persits.MailSender")<BR><BR>T hat&#039;s it.<BR><BR>cheers,<BR><BR>Tam<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts