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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending mail (Set Mail)

Status
Not open for further replies.

MajorTechie

Programmer
Mar 20, 2002
30
0
0
CA
Hello,

I am having problems sending mail using ASP. Internally, the mail sends. But externally, it doesn't. Could this line possibly be the problem?

Set Mail = Server.CreateObject("Persits.MailSender")

Thanks
 
I'm pretty sure it is Persits.
I've not used it either, but I've had issues like that with CDO and idsMail and it's usually (in my case) been if the from address and it's password don't match. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
The IIS version on my web server was not up to date so I had to use that Method. Maybe your syntax is wrong here is a working example.

set objSendMail = Server.CreateObject(&quot;Persits.MailSender&quot;)
objSendMail.Host = &quot;with objSendMail
.from = &quot;blabla@blabla.com&quot;
.AddAddress email 'email = email being sent too
.subject = &quot;blabla&quot;
.body = &quot;blabla&quot;
.send
end with
 
I'm having sort of similar issues (see my post nearby). I tried your example, Gemino, and it didn't work for me, I got an invalid class string error.

And codestorm, please help me out by elaborating on the password thing. I did not know you had to specify a password for the from address, if so, where do you do it? I was under the impression that the mail was sent with the server and so no password was needed (since there was no logging in to any specific mail service). See my post for details of what I'm getting.

-dbromberg
 
Thought I'd copy this from the other thread I posted it in, in case it's of interest, and in case you don't read the other thread.
--------------------------------------------
From my poking around it seems most (sensible) mail servers these days are now set so that only valid email accounts on the server can send mail, and only with the From address matching the address on the mail server you log in as. While you CAN set the mail server to just send any mail from anyone to anyone without any validation, it leaves you open to people using your mail server to send spam.

OK, here's the code from a simple test page a made a while ago (CDOHTMLMailUnicodeTest.vbs - sensitive data stripped) .. it works for me.

(I've also had a variant of this work from within a MSSQL SProc)

Dim obj_Configuration
Dim obj_Message
dim obj_Connection
dim obj_Recordset
dim str_SQL
dim str_Configuration
dim str_To
str_To = &quot;<ToEmailAddress>&quot;
str_Configuration = &quot;Set obj_Connection = CreateObject(&quot;ADODB.Connection&quot;)
obj_Connection.ConnectionString = &quot;DRIVER={SQL

Server};Server=<servername>;Database=<databasename>;UID=<username>;PWD=<password>&quot;
obj_Connection.Open
str_SQL = &quot;Select Q_InstText from quesInstTable where Q_OrgCode = 'Telstra' &quot;
str_SQL = str_SQL & &quot;and Q_ProfileCode = '360FQ'&quot;
Set obj_Recordset = obj_Connection.Execute(str_SQL)
Set obj_Configuration = CreateObject(&quot;CDO.Configuration&quot;)
With obj_Configuration.Fields
.Item(str_Configuration & &quot;sendusing&quot;) = 2
.Item(str_Configuration & &quot;SMTPServer&quot;) = &quot;203.89.65.131&quot; ' Set the SMTP server
.Item(str_Configuration & &quot;SMTPConnectionTimeout&quot;) = 30
.Item(str_Configuration & &quot;SendUserName&quot;) = &quot;<mail server account username(not email address)>&quot;
.Item(str_Configuration & &quot;SendPassword&quot;) = &quot;<password for above>&quot;
.Update
End With
Set obj_Message = CreateObject(&quot;CDO.Message&quot;)
With obj_Message
Set .Configuration = obj_Configuration
.MimeFormatted = True
.Fields.Update
.To = str_To
.From = &quot;<from email address - matches account logged into above>&quot;
.Subject = &quot;Unicode Mail Test - HTML&quot;
.HTMLBody = &quot;<html><head><meta http-equiv=&quot;&quot;Content-Type&quot;&quot; content=&quot;&quot;text/html; charset=&quot; & _
cdoShift_JIS & &quot;&quot;&quot;></HEAD><BODY>&quot; & obj_Recordset.Fields(0).Value & &quot;</BODY></HTML>&quot;
.AddAttachment &quot;c:\bendev\texture01.jpg&quot;
.Send
End With
Set obj_Recordset = Nothing
Set obj_Connection = Nothing
Set obj_Message = Nothing
Set obj_Configuration = Nothing codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top