Jump to content

Sending email

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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...