Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email notification

Status
Not open for further replies.

fule12

Programmer
Nov 12, 2001
140
YU
Hi,
I'm make web page for games wher peaple can registrate and thay select game group (prg,action,sport, etc etc) so when new game is in game group. User how select that gruop recevi e mail notification of new game.
My data base is in Access. and i make same code but problem is if I make new game gruoup and put new game Persits try to send mail ,but bicouse is new group ,so no user for that game group and error came on page :
Technical Information (for support personnel)
Error Type:
Persits.MailSender.4 (0x800A0006)
503 Unexpected command or sequence of commands.
/localhost/game/post.asp, line 339
So can sameone help me.
or if is to mach code just give me same tip like:
do I nead to create new table where is gona be e-mail address of user separate by game group
this is code from post.asp
Set Mail = Server.CreateObject("Persits.MailSender")
Rs.Open "SELECT USER.Name, USER.Email FROM GAMERESUMES INNER JOIN USER ON USER.ID = GAMERESUMES.USERID WHERE USER.WantMails=1 AND GAMERESUMES.Year >= " & Request.Form("cmbYear") & " AND GAMERESUMES.Price >= " & Request.Form("cmbPrice") & " AND (GAMERESUMES.GameCategory=" & Request.Form("cmbCategory") Cn
Mail.Host = "194.154.145.83"
Mail.Port = 25
Mail.From = "metest@test.test"
Mail.FromName = "BalkanJobs"
Mail.Subject = "New Game at Best Game"
Mail.isHTML = True
msg = msg & &quot;New Game at <A HREF=' Game</A> that matches your game group.<BR><BR>&quot; & vbCrLf
msg = msg & &quot;<TABLE WIDTH='495' CELLSPACING='0' CELLPADDING='2'>&quot; & vbCrLf
msg = msg & &quot; <TR BGCOLOR='#DCDCDC'>&quot; & vbCrLf
msg = msg & &quot; <TD WIDTH='375' VALIGN='top'>&quot; & vbCrLf
msg = msg & &quot; <TD WIDTH='120' VALIGN='top' ALIGN='center'>&quot; & vbCrLf
msg = msg & &quot; </TD>&quot; & vbCrLf
msg = msg & &quot; </TR>&quot; & vbCrLf
msg = msg & &quot;</TABLE>&quot; & vbCrLf
msg = msg & &quot;Note: If you would like to stop receiving this notification, &quot; & &quot;<BR>&quot; & vbCrLf
msg = msg & &quot;go to your Edit Profiles page, uncheck box , &quot; & vbCrLf
msg = msg & &quot;next to question: I want to receive mail alert whenever new game......&quot;& &quot;<BR>&quot; & vbCrLf
msg = msg & &quot;Best Game&quot; & vbCrLf
Mail.Body = msg
Do While Not Rs.EOF
Mail.AddAddress Rs.Fields(1), Rs.Fields(0) - I think problem is hire
Rs.MoveNext
Loop
Rs.Close
Mail.Send
Set Mail = Nothing
Thanks
Fule

Fule
 
If you want to send mail more that one email address you must create new object for that. That means you want create new object of each mail

So i correct your code by putting the whole thing in ur databse while loop and creating mail object for every mail and set nothing after send it.

I am also doing the same type of process for my site. i used CDONTS object for sending a mail. I think you are using the trial version of Persists mail component for ur mail sending process. Better you also try the CDONTS object it is similar to this and more easy.

ok here is ur corrected code. i hope this will work
************************************

Rs.Open &quot;SELECT USER.Name, USER.Email FROM GAMERESUMES INNER JOIN USER ON USER.ID = GAMERESUMES.USERID WHERE USER.WantMails=1 AND GAMERESUMES.Year >= &quot; & Request.Form(&quot;cmbYear&quot;) & &quot; AND GAMERESUMES.Price >= &quot; & Request.Form(&quot;cmbPrice&quot;) & &quot; AND (GAMERESUMES.GameCategory=&quot; & Request.Form(&quot;cmbCategory&quot;)Cn

Do While Not Rs.EOF

Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
Mail.Host = &quot;194.154.145.83&quot;
Mail.Port = 25
Mail.From = &quot;metest@test.test&quot;
Mail.FromName = &quot;BalkanJobs&quot;
Mail.Subject = &quot;New Game at Best Game&quot;
Mail.isHTML = True
msg = msg & &quot;New Game at <A HREF=' Game</A> that matches your game group.<BR><BR>&quot; & vbCrLf
msg = msg & &quot;<TABLE WIDTH='495' CELLSPACING='0' CELLPADDING='2'>&quot; & vbCrLf
msg = msg & &quot; <TR BGCOLOR='#DCDCDC'>&quot; & vbCrLf
msg = msg & &quot; <TD WIDTH='375' VALIGN='top'>&quot; & vbCrLf
msg = msg & &quot; <TD WIDTH='120' VALIGN='top' ALIGN='center'>&quot; & vbCrLf
msg = msg & &quot; </TD>&quot; & vbCrLf
msg = msg & &quot; </TR>&quot; & vbCrLf
msg = msg & &quot;</TABLE>&quot; & vbCrLf
msg = msg & &quot;Note: If you would like to stop receiving this notification, &quot; & &quot;<BR>&quot; & vbCrLf
msg = msg & &quot;go to your Edit Profiles page, uncheck box , &quot; & vbCrLf
msg = msg & &quot;next to question: I want to receive mail alert whenever new game......&quot;& &quot;<BR>&quot; & vbCrLf
msg = msg & &quot;Best Game&quot; & vbCrLf
Mail.Body = msg
Mail.AddAddress Rs.Fields(1), Rs.Fields(0)
Mail.Send
Set Mail = Nothing

Rs.MoveNext
Loop

Rs.Close


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

regards
webspy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top