Jump to content

Sending email


Akasha

Recommended Posts

HelloI have an asp webpage with the code for sending an email, this works absolutely fine. No have i copied into a macrofuntion of excel with vbscript.But i getting an error "The transport failed to connect to the server."but in my asp code it works perfect.

Sub SaveInformation()  Const LastMeeting = 10  Dim Meeting    For Meeting = 2 To LastMeeting    If Range("A" & Meeting).Value <> "" And Range("B" & Meeting).Value <> "" And Range("C" & Meeting).Value <> "" And _       Range("D" & Meeting).Value <> "" And Range("E" & Meeting).Value <> "" Then      If Range("F" & Meeting).Value = "" Then                Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"        Const cdoSendUsingPort = 2        Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"        Const cdoSMTPServerCOS = "[I]myserver name[/I]"        Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"        Const cdoSMTPServerPortCOS = 25        Const cdoSMTPConTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"        Const cdoSMTPConTimeoutCOS = 5                Dim objConfig  ' As CDO.Configuration        Dim objMessage ' As CDO.Message        Dim Fields     ' As ADODB.Fields                ' Get a handle on the config object and it's fields        Set objConfig = CreateObject("CDO.Configuration")        Set Fields = objConfig.Fields                ' Set config fields we care about        With Fields            .Item(cdoSendUsingMethod) = cdoSendUsingPort            .Item(cdoSMTPServer) = cdoSMTPServerCOS            .Item(cdoSMTPServerPort) = cdoSMTPServerPortCOS            .Item(cdoSMTPConTimeout) = cdoSMTPConTimeoutCOS                    .Update        End With                ' Sending a text e-mail        Set objMessage = CreateObject("CDO.Message")        Set objMessage.Configuration = objConfig        With objMessage            .To = "nlv15673@prle.natlab.research.philips.com"            .From = "administrator@no-reply.com"            .Subject = "Notification website ITX"            .TextBody = "Best regards"            .BodyPart.AddBodyPart.ContentClass = "urn:content-classes:calendarmessage"            .BodyPart.AddBodyPart.ContentMediaType = "text/vcalendar; charset=""utf-8"""            .Send        End With        Set objMessage = Nothing        Set Fields = Nothing        Set objConfig = Nothing                                Range("F" & Meeting).Value = "Yes"      End If    End If  Next  ActiveWorkbook.SaveEnd Sub

I want to send an calender invitation to lotus notes.How do i do that and what is wrong with the code above???

Link to comment
Share on other sites

But when i put the code into my asp file it works fine, so i guess the server isn't blocked right??

Link to comment
Share on other sites

Generally, servers and hosts do not place limits on things like that, unless it is a free host. It's probably your ISP, not your host, that is the issue. Most ISPs who give internet service to homes do not allow outgoing email due to spam problems.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...