Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 24th, 2005, 02:01 PM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Sending mails.

i use following vbscript function, but not working,
Pls let me know what is wrong?
-------------------------------
Function SendMail(receiver,sender,subject,content)
    Dim ObjSendMail
    Dim iConf
    Dim Flds

    Set ObjSendMail = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields

    Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1

    '**** Path below may need to be changed if it is not correct
    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
    Flds.Update

    Set ObjSendMail.Configuration = iConf
    ObjSendMail.To = receiver
    ObjSendMail.CC = sender
    'ObjSendMail.BCC = receiver & "," & sender
    ObjSendMail.Subject = subject
    ObjSendMail.From = sender

    ' we are sending a html email.. simply switch the comments around to send an text email instead
    ObjSendMail.HTMLBody = content
    'ObjSendMail.TextBody = content

    ObjSendMail.Send

    Set ObjSendMail = Nothing
End Function

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
  #2 (permalink)  
Old October 25th, 2005, 07:22 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

try this script,

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Picco: Send Email</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
'Sending a text email using authentication against a remote SMTP server
' Sample code submitted by Clint Baldwin, +1 (918) 671 3429
Const cdoSendUsingPickup = 1 
Const cdoSendUsingPort = 2 
Const cdoAnonymous = 0
' Use basic (clear-text) authentication. 
Const cdoBasic = 1
' Use NTLM authentication 
Const cdoNTLM = 2 'NTLM

' Create the message object.
Set objMessage = Server.CreateObject("CDO.Message")
'Set the from address this would be your email address.
objMessage.From = """Picco""<crmpicco@aol.com>" 
' Set the TO Address separate multiple address with a comma
objMessage.To = "crmpicco@hotmail.com"
' Set the Subject.
objMessage.Subject = "An Email From Picco." 
' Now for the Message Options Part. 
' Use standared text for the body.
objMessage.TextBody = _
"This is some sample message text.." & _
vbCRLF & _
"It was sent using SMTP authentication."

' Or you could use HTML as:
' objMessage.HTMLBody = strHTML

' ATTACHMENT : Add an attachment Can be any valid url
'objMessage.AddAttachment("file://C:\Program Files\Active Call Center\Examples\Goodbye.wav")

' This section provides the configuration information for the SMTP server.
' Specifie the method used to send messages.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = _
cdoSendUsingPort 

' The name (DNS) or IP address of the machine 
' hosting the SMTP service through which 
' messages are to be sent.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.aol.com" ' Or "mail.server.com"

' Specify the authentication mechanism 
' to use. 
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = _
cdoAnonymous

' The username for authenticating to an SMTP server using basic (clear-text) authentication
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
"crmpicco@aol.com"

' The password used to authenticate 
' to an SMTP server using authentication
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
"*********"

' The port on which the SMTP service 
' specified by the smtpserver field is 
' listening for connections (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = _
25 

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = _
False

' Set the number of seconds to wait for a valid socket to be established with the SMTP service before timing out.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = _
60

' Update configuration
objMessage.Configuration.Fields.Update

' Use to show the message.
' MsgBox objMessage.GetStream.ReadText

' Send the message.
objMessage.Send

%>
</body>
</html>

www.crmpicco.co.uk


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mails How To?? saudyonline General .NET 13 November 17th, 2006 01:00 AM
sending mails arabuafef Classic ASP Basics 0 July 18th, 2006 06:29 AM
INFO on Sending e-mails Varg_88 Beginning PHP 6 November 10th, 2004 04:19 AM
Sending e-mails using C# lily611 General .NET 3 June 30th, 2004 05:46 AM
Sending mails rajeshnerenki Pro VB 6 4 September 25th, 2003 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.